X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 880E89FA279 for ; Tue, 23 May 2006 15:32:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 26239-05 for ; Tue, 23 May 2006 15:32:39 -0300 (ADT) X-Greylist: delayed 00:05:34.669837 by SQLgrey- Received: from mail19.bluewin.ch (mail19.bluewin.ch [195.186.18.65]) by postgresql.org (Postfix) with ESMTP id 69A879FA169 for ; Tue, 23 May 2006 15:32:39 -0300 (ADT) Received: from [192.168.1.74] (62.203.189.28) by mail19.bluewin.ch (Bluewin 7.2.073) id 4461DA910034D781; Tue, 23 May 2006 18:27:02 +0000 From: Ivo Rossacher To: pgsql-admin@postgresql.org Subject: Re: localization, encoding problem Date: Tue, 23 May 2006 20:26:47 +0200 User-Agent: KMail/1.8.2 References: <46f93e0d0605230437w145163c9ke4d41c3576a4b825@mail.gmail.com> In-Reply-To: <46f93e0d0605230437w145163c9ke4d41c3576a4b825@mail.gmail.com> Cc: "j n" MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200605232026.47264.rossacher@bluewin.ch> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/327 X-Sequence-Number: 21859 I think first you need to be aware about the nature of the ASCII encoding=20 within the postgresql server. ASCII encoding means that there is no encodin= g=20 at all. So it would be the full responsibility of the client applications t= o=20 store and read consistent encodings. Therefore it is clear that the server= =20 can not know what he should convert to within the function to_ascii() in th= is=20 case. Second what fore do you need to convert? If you need the conversion for cli= ent=20 readings you only have to set the desired encoding for the client by SET client_encoding =3D '[desired encoding]'; when you open the conncetion to the server. With this setting the server wi= ll=20 convert the texts to the client encoding for you. If you need to change the '=C3=A1' to 'a' you most probably need to write a= =20 function (encoding) which does it for you. However this seems to be a=20 extreemly wirred operation which most possibly should be solved within the= =20 client (by allowing this special charaters or converting them directly befo= re=20 inserting them into the database), then within the server. In the chapter 20.2. Character Set Support in the manual you can find more= =20 details about this issues. Best regards Ivo Rossacher Am Dienstag, 23. Mai 2006 13.37 schrieb j n: > Hellou all > > i have a problem to convert data from utf8 to ascii. My localization is > slovakia and we use characters like > '=C3=A1 =C3=A9 =C5=A1 =C5=A5' and so on. But many times it is the same if= u use '=C3=A1' or 'a'. Som > I need to translate theese special characters. Somebody told me to use > function to_ascii() but this function throws me an error : not supported > encoding to ascii. > > OS : debian > PostgreSQL : 8.1.3 > configured with --enable-multibyte=3DUTF8 > > please help > thanx