Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text

Поиск
Список
Период
Сортировка
От Marc Herbert
Тема Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text
Дата
Msg-id khjacb3hwcd.fsf@meije.emic.fr
обсуждение исходный текст
Ответ на Re: psqlODBC-Driver Test / text fields  ("Dave Page" <dpage@vale-housing.co.uk>)
Ответы Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text  (Bart Samwel <bart@samwel.tk>)
Список pgsql-odbc
Bart Samwel <bart@samwel.tk> writes:
>
> C++ even introduced a special alternative character type "wchar_t" for
> this, just so that people could handle both 8-bit char* and 16-bit
> wchar_t* strings. In wchar_t* strings, 8-bit NULs are not a problem
> because only 16-bit NULs count (and AFAIK the Unicode standard does
> allows this to be interpreted as a NUL aka end-of-string). The
> downside of this solution is that no application actually uses it, and
> everybody is stuck with 8-bit ASCII plus a random local codepage
> unless special support is added.

wchar_t is not defined as 16-bits, but as "wide enough to hold any
character of the platform". For instance if the platform uses UCS-4,
then wchar_t is 32 bits wide.

(UTF-16 wchar_t violates this)


I don't clearly see how you want to use a 8-bit NULL to terminate a
(wider) wchar_t array... ?


> Why didn't they just upgrade chars to 32 bits and be done with
> it... :-/

Because "char" was and is still used to store multibyte /
variable-length / encoded characters.


В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: problem about maximum row size ?
Следующее
От: Bart Samwel
Дата:
Сообщение: Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text