Re: Mis-interpreted extended character

From: Chris <list(at)1006(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Mis-interpreted extended character
Date: 2003-12-13 15:38:46
Message-ID: 1071329925.2161.22.camel@linuxbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


> Our database ( (PostgreSQL) 7.3.5 ) uses Unicode encoding:
> [...]

> For some reason, If I try to use an extended character (ASCII code >
> 127) in a string, I get this peculiar result:

> [...]

Probably your terminal is set to ISO-8859-1 ("latin 1") or something
like that, while your database is set to unicode as you showed.

Hence the mismatch. In unicode (for example UTF-8) non-US-ASCII
characters are encoded with two bytes (as opposed to one byte > 127
as happens with ISO-8859-1). Solution is to have everything agree on the
encoding. Terminal + DB or Web Browser + DB.

Btw. you _do_ actually have an influence on what encoding a web browser
uses by setting the "encoding" HTTP header.

According to my experience, if you have to deal with only western
european encodings, you're better off (still) with ISO-8859-1 (or
ISO-8859-15 to have the EUR symbol too).

Short answer: not PostgreSQL's fault.

Bye, Chris.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kent L. Nasveschuk 2003-12-13 18:55:38 Trigger function
Previous Message Andrew Biagioni 2003-12-13 15:18:18 Mis-interpreted extended character