Re: encoding advice requested

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Rick Schumeyer" <rschumeyer(at)ieee(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: encoding advice requested
Date: 2006-11-12 08:03:33
Message-ID: bf54be870611120003u47c3366dne491dc64e0877ff2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Using the convert function might be of help here as well:

convert(string using conversion_name)

Change encoding using specified conversion name. Conversions can be defined
by CREATE CONVERSION. Also there are some pre-defined conversion names (
http://www.postgresql.org/docs/current/static/functions-string.html#CONVERSION-NAMES
).

select convert('PostgreSQL' using iso_8859_1_to_utf8)

Regards,
--------
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 11/12/06, Martijn van Oosterhout <kleptog(at)svana(dot)org> wrote:
>
> On Sat, Nov 11, 2006 at 02:45:00PM -0500, Rick Schumeyer wrote:
> > My database locale is en_US, and by default my databases are UTF8.
> >
> > My application code allows the user to paste text into a box and submit
> > it to the database. Sometimes the pasted text contains non UTF8
> > characters, typically the "fancy" forms of quotes and apostrophes. The
> > database does not appreciate it when the application attempts to store
> > these characters.
>
> What encoding does your application use? Whatever that is, that's what
> you should be using in your SET client_encoding statement. Note you can
> set that variable per user also.
>
> > b) I can issue a SET CLIENT_ENCODING TO 'LATIN1'; statement every time I
> > open a connection. A brief test indicates this will work.
>
> This is the solution, assuming ofcourse your application is in Latin1.
>
> Have a nice day,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > From each according to his ability. To each according to his ability to
> litigate.
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFFVkxXIB7bNG8LQkwRAtGbAJ0ZQN9xD+JtTDFHL50gIDjf6EpGBACfQi2b
> Fsz8TS1Cnnh7tt6J345H8uo=
> =QMqu
> -----END PGP SIGNATURE-----
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2006-11-12 08:29:02 join condition against where with coalesce
Previous Message Shoaib Mir 2006-11-12 07:54:33 Re: Utility to Convert MS SQL Server to Postgres