pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedEncoding problems
4+ messages / 2 participants
[nested] [flat]
* Encoding problems
@ 2007-03-22 13:07 Bjarni Ragnarsson <bjarnir@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Bjarni Ragnarsson @ 2007-03-22 13:07 UTC (permalink / raw)
To: pgsql-admin
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, but
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?
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Encoding problems
@ 2007-03-22 19:00 Ivo Rossacher <rossacher@bluewin.ch>
parent: Bjarni Ragnarsson <bjarnir@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Ivo Rossacher @ 2007-03-22 19:00 UTC (permalink / raw)
To: pgsql-admin
show client_encoding displays the encoding to which the server currently 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 am 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ärz 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, but
> 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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Encoding problems
@ 2007-03-23 09:52 Bjarni Ragnarsson <bjarnir@gmail.com>
parent: Ivo Rossacher <rossacher@bluewin.ch>
0 siblings, 1 reply; 4+ messages in thread
From: Bjarni Ragnarsson @ 2007-03-23 09:52 UTC (permalink / raw)
To: pgsql-admin
Hi everyone.
Previous message needed some rethinking and was sent like that by my mistake.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Encoding problems
@ 2007-03-23 13:20 Bjarni Ragnarsson <bjarnir@gmail.com>
parent: Bjarni Ragnarsson <bjarnir@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Bjarni Ragnarsson @ 2007-03-23 13:20 UTC (permalink / raw)
To: pgsql-admin
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='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=connection.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 <bjarnir@gmail.com> wrote:
> Hi everyone.
>
> Previous message needed some rethinking and was sent like that by my mistake.
>
> 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 <rossacher@bluewin.ch> wrote:
> > show client_encoding displays the encoding to which the server currently 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 am 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ärz 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, but
> > > 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
> >
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2007-03-23 13:20 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-22 13:07 Encoding problems Bjarni Ragnarsson <bjarnir@gmail.com>
2007-03-22 19:00 ` Ivo Rossacher <rossacher@bluewin.ch>
2007-03-23 09:52 ` Bjarni Ragnarsson <bjarnir@gmail.com>
2007-03-23 13:20 ` Bjarni Ragnarsson <bjarnir@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox