Jean-Christian Imbeault wrote:
> Warning:  PostgreSQL query failed:  ERROR:  Invalid EUC_JP character
> sequence found (0x8140) in /www/htdocs/test.php on line 31
> So I assumed that I should first convert user input into EUC-JP.

Now, let's make sure we have a clear background:
   1) japanese chars come in three flavours:
       a) ISO-2022-JP (the one you are using yourself)
       b) SHIFT-JIS
       c) EUC-JP
   2) your database setting requires you input in c) style while
      you present it values in a) style.

if all that describes your problem you have two ways out of it, which I 
cannot evaluate myself (no personal knowledge of the differences among 
the three charsets).

*Database configuration* if possible, turn your Postgres configuration 
into one that will all three charsets (this will leave you with mixed 
input, though, and it will kill your chances to do a search in your db 
*charset forcing* have your input page always delivered in standard 
format, that is, just one charset. This will free you from charset 
trouble when doing the query, but might end up in having all of your 
forms showing out with a different charset, if your site uses mixed 
charset output.

I usually use the charset approach, because russian all flavours contain 
the same set of characters, it's just a different way of coding them. 
But this solution is not so painless when ported to charset that might 
be "simplified" (like chinese) or not. AFAIK Japanese should be a 
syllabic alphabeth, so probably you can do that just as I can.

If you need to have your pages using a given charset (that is, you have
legacy docs coming in one flavour but your forms need another) you can
simply SPAN your page sections into different charset areas.
that is <SPAN charset="yourset" lang="yourlang"> your text </SPAN>

Mind you, this is handy *and* dangerous. In russian the two SPANned 
sections will look exactly the same, while actually being different. So 
people might end-up cut-and-pasting data from CP-1251 to KOI-8. Not sure 
whether browsers will convert that themselves on the fly. You better 
check it out.



LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to