Page 1 of 1
vfat unicode support
Posted: Mon Nov 25, 2013 9:31 pm
by dryuzarsif
hi everyone. i'm trying to write vfat read/write functions for my kernel. i couldn't found anything about how vfat supports file names which contains unicode characters. I looked into disc records with hex editor. For example if the file name is "表.txt", windows uses long file name method to store it and uses "F697~1 TXT" as 8.3 short name. so what is "F697" ? I saw something like that before when I try to save "a a.txt". ' ' (space) must be skipped cause of 8.3 short name format. but windows converts it to "AA0B35~1TXT". I tryed a few times and the names are always the same so "0B35" is not random. I calculated fat chechsum of "AA0B35~1TXT" and it fits the chechsum of LFN entries. So, how can i convert file name like this as windows?
thank you for your considerations
Re: vfat unicode support
Posted: Tue Nov 26, 2013 12:16 am
by mrstobbe
dryuzarsif wrote:hi everyone. i'm trying to write vfat read/write functions for my kernel. i couldn't found anything about how vfat supports file names which contains unicode characters. I looked into disc records with hex editor. For example if the file name is "表.txt", windows uses long file name method to store it and uses "F697~1 TXT" as 8.3 short name. so what is "F697" ? I saw something like that before when I try to save "a a.txt". ' ' (space) must be skipped cause of 8.3 short name format. but windows converts it to "AA0B35~1TXT". I tryed a few times and the names are always the same so "0B35" is not random. I calculated fat chechsum of "AA0B35~1TXT" and it fits the chechsum of LFN entries. So, how can i convert file name like this as windows?
thank you for your considerations
Short names are (essentially) completely arbitrary in vfat. If you want to write a FAT LFN driver to fully support UCS-2, then just pick something that works in your mind. I wouldn't worry about exactly what Windows picks in this regard, or anyone else. It will work across all platforms as long as the short-name entry immediately follows the last LFN entry, an the checksum matches, you're fine.