Proper encoding of volume_id on ISO-9660

Kay Sievers kay.sievers at vrfy.org
Thu Mar 10 15:30:35 PST 2005


On Tue, 2005-03-08 at 16:21 +0100, Charles Lopes wrote:
> Since work is being done on a volume_id library in hal I thought it 
> could be a good time to point out a bug in this area. On ISO 9660 
> filesystems the label encoding is just assumed to be always UTF-16 BE on 
> suplementary volume descriptors (SVD). This is the case for Joliet SVDs 
> but it's not always the case. ISO-9660 version 2 SVDs for example are 
> supposed to be either ASCII or UTF-8 I believe. ISO-9660 version 2 
> filesystems can be created with "cdrecord -iso-level 4" if someone is 
> interested in testing it. There is a field in the SVD that actually 
> defines the encoding used for the label as an ISO-2022 escape sequence.
> I patched hal on my system so that it compares the escape sequence with 
> the UTF-16 BE codes (I found 3 of them. Not sure why there isn't just 
> one)

Your magics numbers are the 3 possible escape sequences for the
usc-encoding levels.

> and converts the label from UTF-16 BE only if it matches. The patch 
> is not complete in that it just assumes that every non UTF-16 BE label 
> is either UTF-8 or ASCII encoded and I'm not sure if there are any other 
> cases. You'll find this very simple patch here attached.

I've changed the code to read the SVD only if it's a Joliet Extension. 
For other encodings in the SVD we need to match against the escape
sequences.

> I would be very thankful if this patch or a similar solution could be 
> implemented quickly because I keep on being blamed for making CDs with 
> "incorrect labels". :-)

Would be nice if you can test it. I've added a few debug lines if it
doesn't work as expected, please let us know.

Thanks,
Kay

_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list