Re: problem with to_ascii() function in version 8.3.3

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: Pavel Arnošt *EXTERN* <id9848949(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem with to_ascii() function in version 8.3.3
Date: 2008-06-18 09:39:34
Message-ID: D960CB61B694CF459DCFB4B0128514C2023A944C@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pavel Arnošt wrote:
>>> insert into chartest (c) values ('á');
>>> select to_ascii(encode(convert_to(c,'LATIN9'),'escape'),'LATIN9') from chartest;
>>> to_ascii
>>> ----------
>>> \341
>>
>> What answer do you get to the following two SQL statements:
>>
>> SHOW server_encoding;
>> SHOW client_encoding;
>
> both commands shows "UTF8". Changing client encoding with "\encoding
> LATIN9" does not have any effect on to_ascii command (I don't know if
> it should have).

Strange; I have the same settings and it works here.

Could you run the following queries and compare with my results:

test=> select ascii(c) from chartest;
ascii
-------
225
(1 row)

test=> select encode(convert_to(c,'LATIN9'),'hex') from chartest;
encode
--------
e1
(1 row)

test=> select ascii(to_ascii(encode(convert_to(c,'LATIN9'),'escape'),'LATIN9')) from chartest;
ascii
-------
97
(1 row)

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jorge Godoy 2008-06-18 10:25:23 Re: Database design questions
Previous Message Craig Ringer 2008-06-18 09:37:12 Re: Controlling write access to a table