[postgis-devel] iconv + loader

Paul Ramsey pramsey at cleverelephant.ca
Wed Jan 7 08:13:52 PST 2009


I guess for servers running as SQL_ASCII, it could also be useful to
transcode in the client, though if you're running a SQL_ASCII server,
you probably don't care about encodings :)

P

On Wed, Jan 7, 2009 at 3:02 AM, Mark Cave-Ayland
<mark.cave-ayland at siriusit.co.uk> wrote:
> Paul Ramsey wrote:
>
>> I just noticed that we do our character transcoding inside the loader
>> itself and "SET CLIENT_ENCODING = UTF8". Wouldn't it be a lot simpler to
>> just "SET CLIENT_ENCODING = <encoding>" and dump the strings to the server
>> to handle?
>>
>> Anyone know the rationale for the current approach?
>>
>> P
>
> I'm not sure, but I'm wondering if it could be related to escaping
> characters? By converting to UTF8, we know that if we encounter an
> apostrophe in the input string, we can simply escape it by replacing it with
> \' since ASCII is a subset of UTF8. However in non-UTF8 encodings, we have
> no way of knowing what the codepoints for the backslash and apostrophe for a
> given encoding actually are :(
>
>
> ATB,
>
> Mark.
>
> --
> Mark Cave-Ayland
> Sirius Corporation - The Open Source Experts
> http://www.siriusit.co.uk
> T: +44 870 608 0063
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



More information about the postgis-devel mailing list