Re: Using nls to xlate Unicode->charset

Gordon Chaffee (chaffee@CS.Berkeley.EDU)
Sun, 26 Apr 1998 15:27:39 -0700 (PDT)


Inaky Perez Gonzalez writes:
> I need it for the USB strings, as they're coded in
> UNICODE. I've tried to understand the inner workings of nls by lurking
> into fat, ntfs and isods and saw I needed some time more to guess it
> than it'd take to ask if there's a doc, so I thought perhaps somebody
> could enlightent me and thus optimize time :)

The best place to look is in fs/fat/dir.c: uni16_to_x8(). This routine
assume you have an nls_table available with the appropriate character
set to convert the Unicode16 characters to. The loading of a particular
character set is done by fs/fat/inode.c: read_super().

If you instead want to just convert to UTF8, you can use
utf_wcstombs() instead. vfat and Joliet support using either UTF8 or
other character sets such as the ISO charsets.

- Gordon

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu