Locale/UTF8 problem in firefox

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Sep 5 12:35:12 UTC 2007


On Tue, Sep 04, 2007 at 09:05:08PM -0400, Madison Kelly wrote:
> Hi all,
> 
>   I've got an odd problem with firefox. I have a form that a user can 
> enter text into. On save, this is stored in a PostgreSQL database set to 
> UTF-8 (SET client_encoding = 'UTF8';).
> 
>   The problem is, if I enter a UTF8 string like:
> 
> ????????? test.
> 
>   I can see it in the database as:
> 
> nmc=> SELECT dom_admin_note FROM domains WHERE dom_id=2;
>  dom_admin_note
> ----------------
>  ????????? test.
> (1 row)
> 
>   And when I print it to SYSLOG I see:
> 
> [Tue Sep  4 20:55:24 2007] ga.cgi: ga.lib: 388; 'dom_admin_note': [?????? 
> ??? test.]
> 
>   But Firefox shows it as:
> 
> <!-- ga.lib 389 'dom_admin_note': [?????????????????? test.] -->
> ?????????????????? test.
> 
>   First line is viewed in the document source, the second as it appears 
> in the forms 'textarea' field. This is a problem in itself, but doubly 
> so because if a user changes something else, this mangled string gets 
> saved over the good string.
> 
>   Has anyone else here seen a problem like this? Any idea what's going 
> on? My system's locale is 'en_CA.utf8', in case it matters. This error 
> happens even after having cleared the mangled text, re-entered the 
> Japanese text, resaved and redisplayed.

Is your web server sending the header to indicate the page is in UTF-8?
You can check by asking the browser for the page properties I believe
(or just check which character encoding it is currently using).  If the
web server (or php script perhaps in this case) is sending the right
headers then it should just work.

Of course the other question is what format are you telling postgres
that your queries are in?  Is the database configured to operate in
UNICODE mode?

--
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list