화요일, 10월 30, 2007

UNICODE UNDER LINUX

KLDP(http://kldp.org/node/78423)에서 퍼왔는데 이 글도 인용한 글이라 원본글의 소스를 찾을 수가 없네요.

------------------------------

Under GNU/Linux, the C type wchar_t is a signed 32-bit integer type.
Its values are always interpreted by the C library as UCS code values(in all locales), a convention that is signaled by the GNU C library to applications by defining the constant __STDC_ISO_10646__ as specified in the ISO C 99 standard.

UCS/Unicode can be used just like ASCII in input/output streams, terminal communication, plaintext files, filenames, and environment variables in the ASCII compatible UTF-8 multi-byte encoding. To signal the use of UTF-8 as the character encoding to all applications, a suitable locale has to be selected via environment variables (e.g.,"LANG=en_GB.UTF-8").

The nl_langinfo(CODESET) function returns the name of the selected
encoding. Library functions such as wctomb(3) and mbsrtowcs(3) can be used to transform the internal wchar_t characters and strings into the system character encoding and back and wcwidth(3) tells, how many positions (0?2) the cursor is advanced by the output of a character.

Under Linux, in general only the BMP at implementation level 1 should be used at the moment. Up to two combining characters per base character for certain scripts (in particular Thai) are also supported by some UTF-8 terminal emulators and ISO 10646 fonts (level 2), but in general precomposed characters should be preferred where available (Unicode calls this Normalization Form C).

0 Comment: