X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 34993D1D17D for ; Sat, 13 Dec 2003 15:39:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 09019-06 for ; Sat, 13 Dec 2003 11:39:08 -0400 (AST) Received: from my.endian.it (unknown [62.146.87.34]) by svr1.postgresql.org (Postfix) with ESMTP id 60D18D1D0AE for ; Sat, 13 Dec 2003 11:38:48 -0400 (AST) Received: from [192.168.1.2] (host36-118.pool80180.interbusiness.it [80.180.118.36]) (authenticated) by my.endian.it (8.11.6/8.11.6) with ESMTP id hBDG51b16739 for ; Sat, 13 Dec 2003 17:05:01 +0100 Subject: Re: Mis-interpreted extended character From: Chris To: pgsql-admin@postgresql.org In-Reply-To: <3FDB2DBA.8000505@e-greek.net> References: <3FDB2DBA.8000505@e-greek.net> Content-Type: text/plain Message-Id: <1071329925.2161.22.camel@linuxbox> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Sat, 13 Dec 2003 16:38:46 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/181 X-Sequence-Number: 11688 > 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.