Proper encoding of volume_id on ISO-9660

Charles Lopes tjarls at iee.lu
Tue Mar 8 07:21:43 PST 2005


Hello,

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) 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 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". :-) One possible improvement would be to 
additionnally compare with ASCII (easy one, just zeros) and UTF-8 escape 
sequences and not set any volume_id if no match is found.

Charles

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iso9660.patch
Type: text/x-patch
Size: 1045 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20050308/0753451d/iso9660.bin
-------------- next part --------------
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list