Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EEA439FBCC5 for ; Fri, 23 Mar 2007 10:20:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 11153-07 for ; Fri, 23 Mar 2007 10:20:36 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id 2CC2C9FBC9F for ; Fri, 23 Mar 2007 10:20:35 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k3so962305ugf for ; Fri, 23 Mar 2007 06:20:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g7fTRUT/gUAuN6bk6lcjHwGB2XhjLrDL+nZm0eEUJDXdfKhxK2+eON71fj04QFAAGQgXXm4hNMrDO6z3h9/N5wwQzmga5tpjBMLD9zGWUZxP1ukYXB/6JRhXcsn4SWyJI3E2soQ9Ae/72tStDdWyCCHPQfcDjMGKd31vmBEXSkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IZ0s2yeU+sen7yWBv/PH19gVXcUoRprPJL33FTme5KmlPDQIbxT7Ym9qJLEqWU6uGC4zNYyCFHSr4Ca9HRJJhqMnDTXHT41UChWGOd8lK9dWMdSmGLqhPMeWNZY+Qqqe6Q68Q8V/weN37DVkdh49P96oGZqdtaG8Kqg6VphlW68= Received: by 10.115.106.7 with SMTP id i7mr1183259wam.1174656031911; Fri, 23 Mar 2007 06:20:31 -0700 (PDT) Received: by 10.114.61.19 with HTTP; Fri, 23 Mar 2007 06:20:31 -0700 (PDT) Message-ID: <938bcd6f0703230620w20327cfi47e804f540b64a33@mail.gmail.com> Date: Fri, 23 Mar 2007 13:20:31 +0000 From: "Bjarni Ragnarsson" To: pgsql-admin@postgresql.org Subject: Re: Encoding problems In-Reply-To: <938bcd6f0703230252m41830aa1lab734bfe88ea9391@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <938bcd6f0703220607g1d099e45mb266f8cc4f085de5@mail.gmail.com> <200703222000.59688.rossacher@bluewin.ch> <938bcd6f0703230252m41830aa1lab734bfe88ea9391@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/170 X-Sequence-Number: 24994 Hi For those having the same problem ..... 1. You need to change the codepage in shell/command prompt to 1252 (chcp 1252) and set the window to use truetype font to have it displayed correctly. 2. Execute "set client_encoding=3D'win1252';" to have the translation working properly from the shell. How you execute this statement depends on what you're doing.... For Django users: Django doesn't send client_encoding to the database so you need to do that manually. Do step 1 before executing "manage.py shell" (probably the same with dbshell) and then do the following: from django.db import connection c=3Dconnection.cursor() c.execute("set client_encoding to 'win1252';") After that you can work with the models and use save() etc.... That worked for me. Best regards, Bjarni Ragnarsson On 3/23/07, Bjarni Ragnarsson wrote: > Hi everyone. > > Previous message needed some rethinking and was sent like that by my mist= ake. > > From what I figured out now: pgAdmin is using Unicode as the client > setting no matter what the database is set to. The database was set > to win1252. A comment in the settings file states that > client_encoding would default to database settings. But pgAdmin uses > Unicode as client_encoding unless set explicitly. Problem solved. > As a newbie in PostgreSQL I cannot tell if this is a bug.... > > Another problem I was and am still having is communicating with > PostgreSQL via the shell (cmd prompt). The shell uses cp850 and > PostgreSQL doesn's seem to support that by default according to the > docs. How do I go about dealing with that? > > Best regards, > Bjarni Ragnarsson > > On 3/22/07, Ivo Rossacher wrote: > > show client_encoding displays the encoding to which the server current= ly is > > converting. With set client_encoding to UNICODE; you can change the > > client_encoding on the fly and check if the results becomes better. I a= m not > > sure how to adjust the client_encoding in pgAdmin so that this will be = set at > > startup automtically. There is a default client_encoding stored in the = server > > as well but there you have to check if it interfers with your other > > interfaces. > > > > Best regards > > Ivo > > > > Am Donnerstag, 22. M=E4rz 2007 14:07 schrieb Bjarni Ragnarsson: > > > Hi everyone. > > > > > > I have some encoding problems like many others. > > > > > > I'm using Python (and Django) with my PostgreSQL 8.2 and pgAdmin > > > 1.6.2 on Windows XP Pro. The default encoding here in Iceland is > > > win1252. I have a database with that encoding. > > > > > > The problem is that pgAdmin seems to use utf8 no matter what I do. > > > The data seems to be stored correctly when entered via a web-page, bu= t > > > when displayed via pgAdmin it's corrupted (that is the special > > > characters don't show correctly). pgAdmin seems to presume the data > > > is in utf8 format despite the database settings. Entering data via > > > pgAdmin results in corrupted data on the web likewise. > > > > > > Is this a bug or is there some setting I've overlooked? > > > > > > ---------------------------(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 > > > > ---------------------------(end of broadcast)--------------------------= - > > TIP 2: Don't 'kill -9' the postmaster > > >