Re: Knowing the length(convert(username using windows_1251_to_utf8))

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Knowing the length(convert(username using windows_1251_to_utf8))
Дата
Msg-id 20070111134806.GD5836@svana.org
обсуждение исходный текст
Ответ на Re: Knowing the length(convert(username using windows_1251_to_utf8))  ("Alexander Farber" <alexander.farber@gmail.com>)
Список pgsql-general
On Thu, Jan 11, 2007 at 12:37:32PM +0100, Alexander Farber wrote:
> May I ask you an off-topic question? I've read several
> docs on Unicode, but they are difficult to understand.

Have you read the Unicode FAQ?

http://www.cl.cam.ac.uk/~mgk25/unicode.html

> Do you think that an UTF8 string will ever have a 0 byte
> inside of it? Or is it safe to continue using strlen/strlcpy/strcmp
> on the UTF8 values I'll be fetching from my database?

The answer to your questions are no and yes respectivly. See the FAQ.
That is also one of the reasons why Linux/Unix went for utf-8, because
it required minimal changes to programs (and in particular, the C
library).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: han.holl@informationslogik.nl
Дата:
Сообщение: Re: Optimize expresiions.
Следующее
От: "Adam Rich"
Дата:
Сообщение: Re: Optimize expresiions.