Re: [GENERAL] Translate function and strange results ...

2009-11-01 Thread Arjen Nienhuis
On Mon, Nov 2, 2009 at 12:07 AM, Hervé Piedvache wrote: > Hi Tom, > > Thar's mean I need to convert my database in other enconding ? > No you don't. The problem is with the encoding of the query: test=# \encoding SQL_ASCII test=# SELECT convert('Hervé', 'UTF-8', 'LATIN1'); convert -- H

Re: [GENERAL] Translate function and strange results ...

2009-11-01 Thread Hervé Piedvache
Hi Tom, Thar's mean I need to convert my database in other enconding ? Regards, Le dimanche 01 novembre 2009, Tom Lane a écrit : > Arjen Nienhuis writes: > > I don't know why it does that though. Maybe it's the server_encoding. > > What does SHOW server_encoding; tell you? > > He said SQL_ASCI

Re: [GENERAL] Translate function and strange results ...

2009-11-01 Thread Tom Lane
Arjen Nienhuis writes: > I don't know why it does that though. Maybe it's the server_encoding. What > does SHOW server_encoding; tell you? He said SQL_ASCII. translate() will definitely not work nicely with multibyte characters if it doesn't know they are multibyte :-( r

Re: [GENERAL] Translate function and strange results ...

2009-11-01 Thread Arjen Nienhuis
On Sun, Nov 1, 2009 at 4:56 PM, Hervé Piedvache wrote: base=# select translate('Hervé', 'é', 'e'); > translate > --- > Herve > (1 row) > > base=# select translate('Hervé', 'âàäéèêëïöôùüû', 'aaaioouuu'); > translate > --- > Hervai > (1 row) > You are actually doing somethin