Simple Unicode toupper
Posted: Thu Mar 30, 2017 7:10 am
In the FAT file system file names are not case sensitive although the directory set entries for FAT32 LFN and exFAT unicode (16 bit wide character) are stored
in the original case and must be converted to upper case for comparison. The easiest way to do this is with a unicode upcase lookup table.
Every exFAT formatted image comes complete with just such a table. It's a 6K compressed (128K when decompressed) unnamed hidden file in the root
directory identified by the special directory set entry type 0x82. You only need the first half (3K) (even though the table is easy enough to decompress) since
it contains the last in order unicode lower case converted character near the end and even though this half could be compressed it's not.
Simply check the unicode character and if it less than or equal to 0x586 (Armenian small letter 'FEH') use the table to convert to uppercase. Otherwise the
character is either already upcased or (as is the case with all the characters in the second half of the complete table) has no upper case equivalent (for 16bit
unicode wide characters).
If you are not working with exFAT simply grab a copy of the table.
in the original case and must be converted to upper case for comparison. The easiest way to do this is with a unicode upcase lookup table.
Every exFAT formatted image comes complete with just such a table. It's a 6K compressed (128K when decompressed) unnamed hidden file in the root
directory identified by the special directory set entry type 0x82. You only need the first half (3K) (even though the table is easy enough to decompress) since
it contains the last in order unicode lower case converted character near the end and even though this half could be compressed it's not.
Simply check the unicode character and if it less than or equal to 0x586 (Armenian small letter 'FEH') use the table to convert to uppercase. Otherwise the
character is either already upcased or (as is the case with all the characters in the second half of the complete table) has no upper case equivalent (for 16bit
unicode wide characters).
If you are not working with exFAT simply grab a copy of the table.