X-Original-To: pgsql-php@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3FF13474E42 for ; Wed, 30 Apr 2003 04:03:48 -0400 (EDT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by postgresql.org (Postfix) with ESMTP id 3DA6A47638A for ; Wed, 30 Apr 2003 04:03:44 -0400 (EDT) Received: (qmail-ldap/ctrl 45120 invoked from network); 30 Apr 2003 08:03:43 -0000 Received: from unknown (HELO waste.silverserver.co.at) ([194.152.178.7]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 30 Apr 2003 08:03:43 -0000 Received: from cybertec.at (vie-213-129-225-026.async.sil.at [213.129.225.26]) by waste.silverserver.co.at (8.12.9/8.12.8) with ESMTP id h3U83eYI028343; Wed, 30 Apr 2003 10:03:40 +0200 Message-ID: <3EAF8387.1090509@cybertec.at> Date: Wed, 30 Apr 2003 10:04:23 +0200 From: Hans-Juergen Schoenig User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Markus Bertheau , pgsql-php@postgresql.org Subject: Re: Encoding issues References: <3EAD0D1D.7010403@ecologic.de> <1051689089.2476.1.camel@saphir> In-Reply-To: <1051689089.2476.1.camel@saphir> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-35.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/35 X-Sequence-Number: 2005 Markus Bertheau wrote: >=D0=92 =D0=9F=D0=BD=D0=B4, 28.04.2003, =D0=B2 13:14, Dani Oderbolz =D0=BF= =D0=B8=D1=88=D0=B5=D1=82: >=20=20 > >>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 =3D 'LATIN1'; >>update auftraggeber set name_de=3D'Europ=C3=A4ische Union'; >>=20=20=20=20 >> > >Where specificially does the string "Europ=C3=A4ische Union" come from? Is= it >input in a web form? > >=20=20 > >>When I access this in PHP (using this Query: >>SET CLIENT_ENCODING =3D 'LATIN1'; >>select name_de from projekte.sel_auftraggeber; >> >>I get this: >> >>Europ=C3=83=C2=A4ische Union >>=20=20=20=20 >> > >This looks like UTF-8. > >=20=20 > try that one ... we have used this as a basic workaround for some problems we had with=20 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 =3D shift; my $to =3D shift; my $code =3D shift; $converter =3D Text::Iconv->new($from, $to); $converted =3D $converter->convert($code); return $converted; ' LANGUAGE 'plperlu'; -- SELECT iconv('LATIN2', 'IBM437', 'Hallo =C3=9C=C3=BC a'); -- SELECT pg_client_encoding(), iconv(pg_client_encoding(), 'IBM437',=20 'Hallo =C3=9C=C3=BC a'); SELECT iconv(pg_client_encoding(), 'IBM437', 'Hallo =C3=9C=C3=BC a'); maybe this is useful ... Hans