Of course, but it doesn't work !!!
Whatever client encoding I choose in postgresql before COPYing, I get the 'invalid byte sequence error'.

The farther I can get is exporting to UNICODE and importing as UTF8. Then COPY only breaks on the euro symbol (otherwise it breaks very early, I think on the first "non-ascii" character).

--
Like I said before UNICODE <> UTF8 That's why the COPY command breaks on the Euro symbol. You will have to export as UNICODE, then encode it as UTF8, then you won't get the breakage.

UTF8 is simply a means to store UNICODE pretty much as ASCII text.

You could grab a copy of Delphi TurboExplorer and create a import routine using the dbGO ADO components and the PG ODBC driver. Basicly you need to encode any UNICODE data going to the PG server with the system.utf8encode function:

[Delphi] function *UTF8Encode*(const WS: WideString): UTF8String;
Call Utf8Encode to convert a Unicode string to UTF-8. WS is the Unicode string to convert. Utf8Encode returns the corresponding UTF-8 string.

I would imagine that Perl also has such routines, but I don't know for sure. These routines might be in FreePascal as well.

--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

Reply via email to