Обсуждение: Problem with the accents

Поиск
Список
Период
Сортировка

Problem with the accents

От
frederic massot
Дата:
Hello,

I have a problem at the time of requete containing accents with
PostgreSQL version 6.5.3 :

Via psql, the following requete does not function :

SELECT id_dico, name
 FROM  dico_fr
 WHERE name ~* '^bé'
 ORDER BY name;


The tables are coded in UNICODE.

A idee ?

Thank you.
--
==============================================
|              FREDERIC MASSOT               |
|     http://www.juliana-multimedia.com      |
|   mailto:frederic@juliana-multimedia.com   |
===========================Debian=GNU/Linux===

Re: Problem with the accents

От
Tatsuo Ishii
Дата:
> > Are you sure that you put the query in UTF-8 encoding?
>
> Yes :
>
> essai=> SHOW CLIENT_ENCODING;
> NOTICE:  Current client encoding is UNICODE
> SHOW VARIABLE

My point is whether you put the character in UTF-8 or not. Try:

$ echo 'e' > e.txt (e is actually e + accent)
$ od -x e.txt

and show me the result of "cat e.txt"
--
Tatsuo Ishii

Re: Problem with the accents

От
Tatsuo Ishii
Дата:
> I have a problem at the time of requete containing accents with
> PostgreSQL version 6.5.3 :
>
> Via psql, the following requete does not function :
>
> SELECT id_dico, name
>  FROM  dico_fr
>  WHERE name ~* '^bé'
>  ORDER BY name;
>
>
> The tables are coded in UNICODE.

Are you sure that you put the query in UTF-8 encoding?
--
Tatsuo Ishii

Re: Problem with the accents

От
frederic massot
Дата:
Tatsuo Ishii wrote:
>
> > I have a problem at the time of requete containing accents with
> > PostgreSQL version 6.5.3 :
> >
> > Via psql, the following requete does not function :
> >
> > SELECT id_dico, name
> >  FROM  dico_fr
> >  WHERE name ~* '^bé'
> >  ORDER BY name;
> >
> > The tables are coded in UNICODE.
>
> Are you sure that you put the query in UTF-8 encoding?

Yes :

essai=> SHOW CLIENT_ENCODING;
NOTICE:  Current client encoding is UNICODE
SHOW VARIABLE


essai=> \l
datname           |datdba|encoding|datpath
------------------+------+--------+------------
template1         |    31|       5|template1
essai             |  1000|       5|essai


Encoding 5 corresponds has the UNICODE.

Here the sequence of command :

essai=> SELECT * FROM dico_fr WHERE nom ~* '^bé';
essai'>
essai'> '
essai-> ;
id_dico|nom
-------+---
(0 rows)


I am obliged to add a quote and a semicolon to finish the request. :-(

I have the same problem when the requests are sent via PHP, even by
making them precede by:
pg_exec($db_conn, "SET NAMES 'UNICODE'");


Thank you for your assistance.
--
==============================================
|              FREDERIC MASSOT               |
|     http://www.juliana-multimedia.com      |
|   mailto:frederic@juliana-multimedia.com   |
===========================Debian=GNU/Linux===