Re: Knowing the length(convert(username using windows_1251_to_utf8)) - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Knowing the length(convert(username using windows_1251_to_utf8))
Date
Msg-id 20070111134806.GD5836@svana.org
Whole thread Raw
In response to Re: Knowing the length(convert(username using windows_1251_to_utf8))  ("Alexander Farber" <alexander.farber@gmail.com>)
List 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.

Attachment

pgsql-general by date:

Previous
From: han.holl@informationslogik.nl
Date:
Subject: Re: Optimize expresiions.
Next
From: "Adam Rich"
Date:
Subject: Re: Optimize expresiions.