browser shows garbage instead of UTF-8 characters

Lists: pgsql-generalpgsql-jdbc
From: "Sadm sadm" <sadm(at)bsdmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: browser shows garbage instead of UTF-8 characters
Date: 2006-04-13 11:12:42
Message-ID: 20060413111242.27E6ACA0A4@ws5-11.us4.outblaze.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

Hello!
I have a PostgreSQL database with UTF-8 encoding. It stores russian characters.
When I fetch a record from this database and output it to the web browser as html page, it
looks like a garbage instead of normal russian characters. I'm using html with <meta http-equiv="Content-Type" content="text/html; charset=utf-8">.

Please help me to find a mistake.
Thanks in advance.

--
_______________________________________________
Get your free email from http://mymail.bsdmail.com


From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "Sadm sadm" <sadm(at)bsdmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: browser shows garbage instead of UTF-8 characters
Date: 2006-04-13 14:16:36
Message-ID: 7be3f35d0604130716i4605e347r3c71eb6d5d963ae3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

Sadm,

what is the encoding setting of your database driver?

What happens if you put out the retrieved Data to a console or a debug
window?

Have you analyzed the garbage, what is it? Escaped Characters? Hungarian?
Arabian? Chinese??

How do you "fetch a record", how do you output it to "THE" "Web browser"?
What are your HTML Headers? Which HTML / XHTML do you use?

Harald

On 4/13/06, Sadm sadm <sadm(at)bsdmail(dot)com> wrote:
>
> Hello!
> I have a PostgreSQL database with UTF-8 encoding. It stores russian
> characters.
> When I fetch a record from this database and output it to the web browser
> as html page, it
> looks like a garbage instead of normal russian characters. I'm using html
> with <meta http-equiv="Content-Type" content="text/html; charset=utf-8">.
>
> Please help me to find a mistake.
> Thanks in advance.
>
>
> --
> _______________________________________________
> Get your free email from http://mymail.bsdmail.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
PostgreSQL - supported by a community that does not put you on hold


From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: browser shows garbage instead of UTF-8 characters
Date: 2006-04-13 15:29:49
Message-ID: 200604131729.49793.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

On Thursday 13 April 2006 13:12, Sadm sadm wrote:
>Hello!
>I have a PostgreSQL database with UTF-8 encoding. It stores russian
> characters. When I fetch a record from this database and output it to
> the web browser as html page, it looks like a garbage instead of
> normal russian characters. I'm using html with <meta
> http-equiv="Content-Type" content="text/html; charset=utf-8">.
>
>Please help me to find a mistake.
>Thanks in advance.

If you're using PHP, you should issue the command:

pg_set_client_encoding($db, $encoding);

I don't know which value of $encoding you should use with Cyrillic
letters, but I'm using LATIN1 which works fine with Norwegian.
--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE