From: | Hans-Juergen Schoenig <postgres(at)cybertec(dot)at> |
---|---|
To: | Markus Bertheau <twanger(at)bluetwanger(dot)de>, pgsql-php(at)postgresql(dot)org |
Subject: | Re: Encoding issues |
Date: | 2003-04-30 08:04:23 |
Message-ID: | 3EAF8387.1090509@cybertec.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
Markus Bertheau wrote:
>В Пнд, 28.04.2003, в 13:14, Dani Oderbolz пишет:
>
>
>>Hi all,
>>
>>I have got a problem with the encoding of special caracters.
>>My DB uses the Encoding 'LATIN1'.
>>I modify data like this in psql:
>>
>>SET CLIENT_ENCODING = 'LATIN1';
>>update auftraggeber set name_de='Europäische Union';
>>
>>
>
>Where specificially does the string "Europäische Union" come from? Is it
>input in a web form?
>
>
>
>>When I access this in PHP (using this Query:
>>SET CLIENT_ENCODING = 'LATIN1';
>>select name_de from projekte.sel_auftraggeber;
>>
>>I get this:
>>
>>Europäische Union
>>
>>
>
>This looks like UTF-8.
>
>
>
try that one ...
we have used this as a basic workaround for some problems we had with
encoding ...
-- converts any character set to any character set ...
CREATE OR REPLACE FUNCTION iconv(text, text, text) RETURNS text AS '
use Text::Iconv;
my $from = shift;
my $to = shift;
my $code = shift;
$converter = Text::Iconv->new($from, $to);
$converted = $converter->convert($code);
return $converted;
' LANGUAGE 'plperlu';
-- SELECT iconv('LATIN2', 'IBM437', 'Hallo Üü a');
-- SELECT pg_client_encoding(), iconv(pg_client_encoding(), 'IBM437',
'Hallo Üü a');
SELECT iconv(pg_client_encoding(), 'IBM437', 'Hallo Üü a');
maybe this is useful ...
Hans
From | Date | Subject | |
---|---|---|---|
Next Message | Andrei Verovski (aka MacGuru) | 2003-05-06 08:42:30 | Strange problem with session and header("Location:script.php?".SID) |
Previous Message | Markus Bertheau | 2003-04-30 07:51:30 | Re: Encoding issues |