опять программистское
Aug. 1st, 2005 12:24 pmИдиотский баг дня. Интерфейс библиотеки (которую пишет другой отдел) требует передавать ей юникодные строки (указатель на wchar_t). При этом саму библиотеку они перевели с Windows на юникс, оставив внутренний тип двухбайтным, в то время как в юниксе wchar_t четырёхбайтный обычно всё же. В интерфейсе или документации этот незначительный факт они не указали.
Я ненавижу компьютеры. Но ещё больше я ненавижу программистов.
Я ненавижу компьютеры. Но ещё больше я ненавижу программистов.
no subject
Date: 2005-08-01 11:26 am (UTC)Encoding Forms
Character encoding standards define not only the identity of each character and its numeric value, or code point, but also how this value is represented in bits.
The Unicode Standard defines three encoding forms that allow the same data to be transmitted in a byte, word or double word oriented format (i.e. in 8, 16 or 32-bits per code unit). All three encoding forms encode the same common character repertoire and can be efficiently transformed into one another without loss of data. The Unicode Consortium fully endorses the use of any of these encoding forms as a conformant way of implementing the Unicode Standard.
UTF-8 is popular for HTML and similar protocols. UTF-8 is a way of transforming all Unicode characters into a variable length encoding of bytes. It has the advantages that the Unicode characters corresponding to the familiar ASCII set have the same byte values as ASCII, and that Unicode characters transformed into UTF-8 can be used with much existing software without extensive software rewrites.
UTF-16 is popular in many environments that need to balance efficient access to characters with economical use of storage. It is reasonably compact and all the heavily used characters fit into a single 16-bit code unit, while all other characters are accessible via pairs of 16-bit code units.
UTF-32 is popular where memory space is no concern, but fixed width, single code unit access to characters is desired. Each Unicode character is encoded in a single 32-bit code unit when using UTF-32.
All three encoding forms need at most 4 bytes (or 32-bits) of data for each character.
То, что сейчас он "обычно двухбайтный" - это просто "так получилось".
no subject
Date: 2005-08-01 11:37 am (UTC)Пока не поймут смысл этого слова.
no subject
Date: 2005-08-21 12:25 pm (UTC)