pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Pb with the French accentuated characters
5+ messages / 2 participants
[nested] [flat]

* Pb with the French accentuated characters
@ 2002-04-30 12:51 frederic massot <frederic@juliana-multimedia.com>
  2002-04-30 13:22 ` Re: Pb with the French accentuated characters Jean-Michel POURE <jm.poure@freesurf.fr>
  0 siblings, 1 reply; 5+ messages in thread

From: frederic massot @ 2002-04-30 12:51 UTC (permalink / raw)
  To: pgsql-php

Hello,

Since the update of a PC of test (Debian GNU/Linux Woody, Apache
1.3.23-1, Php4 4.1.2, Postgresql 7.2.1), the Web sites functioning on
this PC produce errors during the insertion of French accentuated 
characters ("é", "è", "à", etc...) in the databases.

An error message with PHP : 

PostgreSQL query failed:  ERROR:  Invalid UNICODE character sequence
found (0xe97373)

Error messages with psql : 

juliana=> insert into essai values ('était');
ERROR:  Invalid UNICODE character sequence found (0xe97461)
juliana=> insert into essai values ('ètait');
ERROR:  Invalid UNICODE character sequence found (0xe87461)
juliana=> insert into essai values ('àtait');
ERROR:  Invalid UNICODE character sequence found (0xe07461)


With version 7.1.3 of Postgresql not did not have any errors. 

All the databases are encoding in UNICODE.

Postgresql is compiled with the option "--enable-unicode-conversion". 

I know that version 7.2.1 of Postgresql checks the data before inserting
them. But I do not understand why conversion does not function.

Do you have an idea ? 

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Pb with the French accentuated characters
  2002-04-30 12:51 Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
@ 2002-04-30 13:22 ` Jean-Michel POURE <jm.poure@freesurf.fr>
  2002-04-30 13:56   ` Re: Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
  2002-04-30 16:56   ` Re: Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Jean-Michel POURE @ 2002-04-30 13:22 UTC (permalink / raw)
  To: frederic massot <frederic@juliana-multimedia.com>; pgsql-php

Le Mardi 30 Avril 2002 14:51, frederic massot a écrit :
> Since the update of a PC of test (Debian GNU/Linux Woody, Apache
> 1.3.23-1, Php4 4.1.2, Postgresql 7.2.1), the Web sites functioning on
> this PC produce errors during the insertion of French accentuated
> characters ("é", "è", "à", etc...) in the databases.
> An error message with PHP :
> PostgreSQL query failed:  ERROR:  Invalid UNICODE character sequence
> found (0xe97373)

So I presume your database is Unicode.

> Error messages with psql :
> juliana=> insert into essai values ('était');
> ERROR:  Invalid UNICODE character sequence found (0xe97461)
> juliana=> insert into essai values ('ètait');
> ERROR:  Invalid UNICODE character sequence found (0xe87461)
> juliana=> insert into essai values ('àtait');
> ERROR:  Invalid UNICODE character sequence found (0xe07461)

Enter:
SET CLIENT_ENCODING = 'Latin9'

This will recode backend<->client stream from Unicode to Latin + Euro 
encoding. If you don't need Euro support, you could also recode to Latin1.

Otherwise, when importing text from a flat file (Latin) into a unicode 
database (UTF8), recode the file using :

recode ..u8 filename.sql

Cheers,
Jean-Michel POURE




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Pb with the French accentuated characters
  2002-04-30 12:51 Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
  2002-04-30 13:22 ` Re: Pb with the French accentuated characters Jean-Michel POURE <jm.poure@freesurf.fr>
@ 2002-04-30 13:56   ` frederic massot <frederic@juliana-multimedia.com>
  2002-04-30 14:27     ` Re: Pb with the French accentuated characters Jean-Michel POURE <jm.poure@freesurf.fr>
  1 sibling, 1 reply; 5+ messages in thread

From: frederic massot @ 2002-04-30 13:56 UTC (permalink / raw)
  To: pgsql-php

Jean-Michel POURE wrote:
> 
> 
> Enter:
> SET CLIENT_ENCODING = 'Latin9'
> 
> This will recode backend<->client stream from Unicode to Latin + Euro
> encoding. If you don't need Euro support, you could also recode to Latin1.
> 

Ok, but for a site allowing the updates of the data for a French users,
or for a Brazilian, with the same interface ?

Sometimes our customers are not French.
Certain parts of the Web site will be updated with French characters,
others with non French characters.
-- 
==============================================
|              FREDERIC MASSOT               |
|     http://www.juliana-multimedia.com      |
|   mailto:frederic@juliana-multimedia.com   |
===========================Debian=GNU/Linux===



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Pb with the French accentuated characters
  2002-04-30 12:51 Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
  2002-04-30 13:22 ` Re: Pb with the French accentuated characters Jean-Michel POURE <jm.poure@freesurf.fr>
  2002-04-30 13:56   ` Re: Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
@ 2002-04-30 14:27     ` Jean-Michel POURE <jm.poure@freesurf.fr>
  0 siblings, 0 replies; 5+ messages in thread

From: Jean-Michel POURE @ 2002-04-30 14:27 UTC (permalink / raw)
  To: frederic massot <frederic@juliana-multimedia.com>; pgsql-php

Le Mardi 30 Avril 2002 15:56, frederic massot a écrit :
> Ok, but for a site allowing the updates of the data for a French users,
> or for a Brazilian, with the same interface ?
> Sometimes our customers are not French.
> Certain parts of the Web site will be updated with French characters,
> others with non French characters.

Latin9 means ISO_8859-15 = all Western languages.
This should work for Brazilian.

Otherwise, if you need Arabic + Japanese + French + etc..,
use a complete Unicode chain:

1) Your web pages (.php) should be saved in UTF-8 format.

2) Your web pages (.php) should send UTF-8 headers to the internet browser (to 
tell the browser to switch to UTF-8).

3) PHP should be compiled with mb options enabled. 
See http://uk.php.net/manual/en/ref.mbstring.php.
Otherwize you wron't be able to calculate string lenght, etc...
mbstring.func_overload should be set to 4 in php.ini to automatically
overload PHP functions with their ITF-8 equivalent.

Have fun,
Jean-Michel POURE



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Pb with the French accentuated characters
  2002-04-30 12:51 Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
  2002-04-30 13:22 ` Re: Pb with the French accentuated characters Jean-Michel POURE <jm.poure@freesurf.fr>
@ 2002-04-30 16:56   ` frederic massot <frederic@juliana-multimedia.com>
  1 sibling, 0 replies; 5+ messages in thread

From: frederic massot @ 2002-04-30 16:56 UTC (permalink / raw)
  To: pgsql-php

Jean-Michel POURE wrote:
> 
> 
> So I presume your database is Unicode.
> 
> > Error messages with psql :
> > juliana=> insert into essai values ('était');
> > ERROR:  Invalid UNICODE character sequence found (0xe97461)
> > juliana=> insert into essai values ('ètait');
> > ERROR:  Invalid UNICODE character sequence found (0xe87461)
> > juliana=> insert into essai values ('àtait');
> > ERROR:  Invalid UNICODE character sequence found (0xe07461)
> 
> Enter:
> SET CLIENT_ENCODING = 'Latin9'
> 
> This will recode backend<->client stream from Unicode to Latin + Euro
> encoding. If you don't need Euro support, you could also recode to Latin1.

I have just tested your solutions:

juliana=> select * from essai;
 un
----
(0 rows)

juliana=> insert into essai values ('était');
ERROR:  Invalid UNICODE character sequence found (0xe97461)
juliana=> SET CLIENT_ENCODING = 'latin9';
SET VARIABLE
juliana=> insert into essai values ('était');
INSERT 225971 1
juliana=> select * from essai;
  un
------
 tait
(1 row)

juliana=> SET CLIENT_ENCODING = 'latin1';
SET VARIABLE
juliana=> insert into essai values ('était');
INSERT 225972 1
juliana=> select * from essai;
  un
------
 tait
 tait
(2 rows)


There is always a problem with the accents, Arghh !!!

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2002-04-30 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-04-30 12:51 Pb with the French accentuated characters frederic massot <frederic@juliana-multimedia.com>
2002-04-30 13:22 ` Jean-Michel POURE <jm.poure@freesurf.fr>
2002-04-30 13:56   ` frederic massot <frederic@juliana-multimedia.com>
2002-04-30 14:27     ` Jean-Michel POURE <jm.poure@freesurf.fr>
2002-04-30 16:56   ` frederic massot <frederic@juliana-multimedia.com>

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