From: Ivo Rossacher <rossacher@bluewin.ch>
To: pgsql-admin@postgresql.org
Cc: j n <jneuschld@gmail.com>
Subject: Re: localization, encoding problem
Date: Tue, 23 May 2006 20:26:47 +0200
Message-ID: <200605232026.47264.rossacher@bluewin.ch> (raw)
In-Reply-To: <46f93e0d0605230437w145163c9ke4d41c3576a4b825@mail.gmail.com>
References: <46f93e0d0605230437w145163c9ke4d41c3576a4b825@mail.gmail.com>
I think first you need to be aware about the nature of the ASCII encoding
within the postgresql server. ASCII encoding means that there is no encoding
at all. So it would be the full responsibility of the client applications to
store and read consistent encodings. Therefore it is clear that the server
can not know what he should convert to within the function to_ascii() in this
case.
Second what fore do you need to convert? If you need the conversion for client
readings you only have to set the desired encoding for the client by
SET client_encoding = '[desired encoding]';
when you open the conncetion to the server. With this setting the server will
convert the texts to the client encoding for you.
If you need to change the 'á' to 'a' you most probably need to write a
function (encoding) which does it for you. However this seems to be a
extreemly wirred operation which most possibly should be solved within the
client (by allowing this special charaters or converting them directly before
inserting them into the database), then within the server.
In the chapter 20.2. Character Set Support in the manual you can find more
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
> 'á é š ť' and so on. But many times it is the same if u use 'á' 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=UTF8
>
> please help
> thanx
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: rossacher@bluewin.ch, jneuschld@gmail.com
Subject: Re: localization, encoding problem
In-Reply-To: <200605232026.47264.rossacher@bluewin.ch>
References: <46f93e0d0605230437w145163c9ke4d41c3576a4b825@mail.gmail.com> <200605232026.47264.rossacher@bluewin.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox