Re: EOL characters and multibyte encodings

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: William ZHANG <zedware(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EOL characters and multibyte encodings
Date: 2007-06-22 12:11:53
Message-ID: 467BBC89.8000104@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

William ZHANG wrote:
>>>
>>> It's safe, because you'll be dealing with prosrc inside the backend,
>>> therefore using a backend-legal encoding, and those don't have any ASCII
>>> aliasing problems (all bytes of an MB character must have high bit set).
>>>
>
> The lower byte of some characters in BIG5, GBK, GB18030 may be less than
> 0x7F and don't have the high bit set. Fortunately, they don't use 0x0D and
> 0x0A (CR and LF).
>
>
>

Those are client-only encodings, precisely for this sort of reason, and
thus not relevant to the present discussion. As Tom points out above,
when the language handler gets the code it will be encoded in the
relevant backend encoding which can't be any of these.

(Side note: the restriction by the R parser to unix-only line endings is
a dreadful piece of design. As Jon Postel rightly said, the best rule is
"Be liberal in what you accept and conservative in what you send." Just
about every parser for every language has been able to handle this, so
why must R be different?)

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2007-06-22 13:14:40 Re: Worries about delayed-commit semantics
Previous Message Gregory Stark 2007-06-22 11:21:38 Re: Worries about delayed-commit semantics