Dnia 13-07-2009 o 19:58:50 Craig Ringer <craig@postnewspapers.com.au>
napisał(a):
> (Please reply to the list, not just to me)
>
I'm sorry.
> I'd still like to know how you're setting your client encoding. You
> can't just run "SET client_encoding='win1250'" - you must tell the
> client program, or the terminal it runs in, to use the appropriate
> encoding as well. Otherwise when you paste the per-mille character
> you'll see the right glyph, but the CLIENT will interpret that as the
> character in the encoding you specified.
>
> So, if you're using a utf-8 terminal, that means that the terminal will
> send 0xe2 0x80 0xb0 for per-mille, which when interpreted as win1250
> becomes ‰ , so that's what the server thinks you sent it.
>
> In that case, though, you'd find that the euro symbol, which isn't
> defined in latin-2, will cause an error:
>
> ERROR: character 0xe282ac of encoding "UTF8" has no equivalent in
> "LATIN2"
>
I didn't use terminal, I used pgAdmin III for first test
and you're right, this was not good idea, but somehow
validation for invalid characters work properly.
For later tests I used python-psycopg2 script.
--
Robert Świętochowski
__
AKPA Polska Press Sp. z o.o., 02-221 Warszawa, ul. Zbąszyńska 5, NIP 521-10-00-270
Sąd Rejonowy dla m.st. Warszawy, XIII Wydział Gospodarczy KRS 0000023945;
Kapitał zakładowy 516.900,00 PLN (w całości opłacony).