Обсуждение: PgAdmin on Windows - UTF8 and WIN1252

Поиск
Список
Период
Сортировка

PgAdmin on Windows - UTF8 and WIN1252

От
Baptiste GONOD
Дата:
Hi,<br /><br />is it possible to have a database encoded utf8 and a correct display in pgAdmin on (Windows) ?<br /><br
/>Allmy attempts of setting had failed and display the data encoded Windows-1252 :<br /><br />- update client_encoding
in.cong<br /> - install version 8.3 (choosing server and client encode)<br />- install phpPgAdmin<br />- use <span
class=""id="result_box" lang="en"><span class="">environment variables<br />- delete and create cluster in command
line<br/>- install some over versions on other computer<br /><br />thanks.<br />Bat.<br /></span></span><br /> 

Re: PgAdmin on Windows - UTF8 and WIN1252

От
Dave Page
Дата:
On Fri, Dec 14, 2012 at 7:54 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> Hi,
>
> is it possible to have a database encoded utf8 and a correct display in
> pgAdmin on (Windows) ?

Yes - people do it all the time, myself included. You don't need to do
anything to make it work - just connect, pgAdmin will set the client
encoding to UTF8 (which it always uses, except with SQL-ASCII
databases), and the server will do any required conversion if the
database encoding isn't already UTF8.

> All my attempts of setting had failed and display the data encoded
> Windows-1252 :

You cannot "see" encoding - you can only see that something went
wrong, so you can't say it displays the data in a different, specific
encoding. pgAdmin uses UTF-8 exclusively internally, so that is always
what will be rendered. Knowing that this has worked correctly for many
years, my gut feeling would be that either your database isn't encoded
as you think and is actually SQL-ASCII, or your front-end app is
messing up the encoding of what's being stored (and likely what it
displays as well, so you don't notice), which then gets displayed
differently by pgAdmin.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PgAdmin on Windows - UTF8 and WIN1252

От
Dave Page
Дата:
[Please keep replies on the mailing list]

On Fri, Dec 14, 2012 at 10:08 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> psql -l return that database is utf8 and show client_encoding too.
> And I install postgre on two computers, with different versions.
>
>
>>"your front-end app is messing up the encoding of what's being stored (and
>> likely what it displays as well, so you don't notice)"
> So the problem is Windows ?! It's a french version.
> It's impossible all users of windows don't notice that. The some topic on
> Internet on that problem are not solved.

No - Windows doesn't have a native client for PostgreSQL. I'm talking
about whatever application you've got that's running on top of
PostgreSQL.

>> "Knowing that this has worked correctly for many years"
> For windows'user too ?! Are you sure? :(

Positive. Most of pgAdmin was developed on Windows.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PgAdmin on Windows - UTF8 and WIN1252

От
Dave Page
Дата:
On Fri, Dec 14, 2012 at 10:26 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> < [Please keep replies on the mailing list]
>> Someone give me pgadmin-support@postgresql.org so where do I must post ?
>> Send to the same mail ?

To pgadmin-support@postgresql.org. Just hit Reply All, so the list is CC'd.

> < I'm talking about whatever application you've got that's running on top of
> PostgreSQL.
>> What kind of app ?? Can you give me an example, because I don't see what
>> app can run in front of postgre ! :O

Virtually noone will run PostgreSQL without an app in front of it.
That might be a website, an ERP system or something like Drupal or
MediaWiki. The whole product is designed to sit behind an application
of some sort.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PgAdmin on Windows - UTF8 and WIN1252

От
Dave Page
Дата:
On Fri, Dec 14, 2012 at 10:46 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> Ok that's a front-end. My problem isn't with my website.. he's work fine in
> utf8 with postgreSQL in utf8 - tested with pg_connect or odbc connection.

OK.

> PgAdmin is a front-end too, not ?! And it's pgadmin that doesn't display
> data in utf8. All is encoded in WIN1252 whereas all settings are
> utf8/unicode in all options.

You said your database was UTF-8. So where does WIN1252 come into
this? If the database is in UTF-8, pgAdmin uses UTF-8 internally,
there should never be any WIN1252 involved at all.

> More, phppgadmin has the same problem. So we could conclude that my database
> isn't in utf8, but postgreSQL say no.

If phpPgAdmin has the same issue, than that also implies there's
something getting messed up in your front end, that causing data to be
stored differently than you expect. Both pgAdmin and phpPgAdmin have
been used for 10+ years by hundreds of thousands of people with UTF-8
data.

> So, pgadmin and phpadmin use the same device to collect data ? And this is
> the way which wrong ?

The only common thing between them is libpq - which is also used by
psql, pg_dump, pg_restore etc. It's even more tried and tested than
the admin tools, as every single PostgreSQL installation there is
relies on it.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PgAdmin on Windows - UTF8 and WIN1252

От
Baptiste GONOD
Дата:
Ok that's a front-end. My problem isn't with my website.. he's work fine in utf8 with postgreSQL in utf8 - tested with pg_connect or odbc connection.

PgAdmin is a front-end too, not ?! And it's pgadmin that doesn't display data in utf8. All is encoded in WIN1252 whereas all settings are utf8/unicode in all options.
More, phppgadmin has the same problem. So we could conclude that my database isn't in utf8, but postgreSQL say no.

So, pgadmin and phpadmin use the same device to collect data ? And this is the way which wrong ?

I don't understand.. ^^'


2012/12/14 Dave Page <dpage@pgadmin.org>
On Fri, Dec 14, 2012 at 10:26 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> < [Please keep replies on the mailing list]
>> Someone give me pgadmin-support@postgresql.org so where do I must post ?
>> Send to the same mail ?

To pgadmin-support@postgresql.org. Just hit Reply All, so the list is CC'd.

> < I'm talking about whatever application you've got that's running on top of
> PostgreSQL.
>> What kind of app ?? Can you give me an example, because I don't see what
>> app can run in front of postgre ! :O

Virtually noone will run PostgreSQL without an app in front of it.
That might be a website, an ERP system or something like Drupal or
MediaWiki. The whole product is designed to sit behind an application
of some sort.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: PgAdmin on Windows - UTF8 and WIN1252

От
Baptiste GONOD
Дата:
< You said your database was UTF-8. So where does WIN1252 come into this? If the database is in UTF-8, pgAdmin uses UTF-8 internally, there should never be any WIN1252 involved at all.

>
when I install postgreSQL or create my cluster by command line, my database is encoded in utf8, but collation and type of char are French_France.1252. And if I try something like :

initdb --locale French_France.UTF8 -D "..."
initdb --encoding utf8 --locale French_France -D "..."
initdb --encoding utf8 --locale utf8 -D "..."
...
or something else about utf8, system says that the locale isn't know and set default to french_france.1252.

And when I look data with pgadmin, there's a conversion utf8 to WIN1252 of my data (on display, not in stored).

At the install of postgreSQL, it ask the locales. Do I must choose another choice of French ?


2012/12/14 Dave Page <dpage@pgadmin.org>
On Fri, Dec 14, 2012 at 10:46 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> Ok that's a front-end. My problem isn't with my website.. he's work fine in
> utf8 with postgreSQL in utf8 - tested with pg_connect or odbc connection.

OK.

> PgAdmin is a front-end too, not ?! And it's pgadmin that doesn't display
> data in utf8. All is encoded in WIN1252 whereas all settings are
> utf8/unicode in all options.

You said your database was UTF-8. So where does WIN1252 come into
this? If the database is in UTF-8, pgAdmin uses UTF-8 internally,
there should never be any WIN1252 involved at all.

> More, phppgadmin has the same problem. So we could conclude that my database
> isn't in utf8, but postgreSQL say no.

If phpPgAdmin has the same issue, than that also implies there's
something getting messed up in your front end, that causing data to be
stored differently than you expect. Both pgAdmin and phpPgAdmin have
been used for 10+ years by hundreds of thousands of people with UTF-8
data.

> So, pgadmin and phpadmin use the same device to collect data ? And this is
> the way which wrong ?

The only common thing between them is libpq - which is also used by
psql, pg_dump, pg_restore etc. It's even more tried and tested than
the admin tools, as every single PostgreSQL installation there is
relies on it.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: PgAdmin on Windows - UTF8 and WIN1252

От
Dave Page
Дата:
Guillaume, can you provide any input here please? I only have English
systems to hand, so can't even properly test this.

On Fri, Dec 14, 2012 at 11:12 AM, Baptiste GONOD
<baptiste.gonod@gmail.com> wrote:
> < You said your database was UTF-8. So where does WIN1252 come into this? If
> the database is in UTF-8, pgAdmin uses UTF-8 internally, there should never
> be any WIN1252 involved at all.
>
>>
> when I install postgreSQL or create my cluster by command line, my database
> is encoded in utf8, but collation and type of char are French_France.1252.
> And if I try something like :
>
> initdb --locale French_France.UTF8 -D "..."
> initdb --encoding utf8 --locale French_France -D "..."
> initdb --encoding utf8 --locale utf8 -D "..."
> ...
> or something else about utf8, system says that the locale isn't know and set
> default to french_france.1252.
>
> And when I look data with pgadmin, there's a conversion utf8 to WIN1252 of
> my data (on display, not in stored).
>
> At the install of postgreSQL, it ask the locales. Do I must choose another
> choice of French ?
>
>
>
> 2012/12/14 Dave Page <dpage@pgadmin.org>
>>
>> On Fri, Dec 14, 2012 at 10:46 AM, Baptiste GONOD
>> <baptiste.gonod@gmail.com> wrote:
>> > Ok that's a front-end. My problem isn't with my website.. he's work fine
>> > in
>> > utf8 with postgreSQL in utf8 - tested with pg_connect or odbc
>> > connection.
>>
>> OK.
>>
>> > PgAdmin is a front-end too, not ?! And it's pgadmin that doesn't display
>> > data in utf8. All is encoded in WIN1252 whereas all settings are
>> > utf8/unicode in all options.
>>
>> You said your database was UTF-8. So where does WIN1252 come into
>> this? If the database is in UTF-8, pgAdmin uses UTF-8 internally,
>> there should never be any WIN1252 involved at all.
>>
>> > More, phppgadmin has the same problem. So we could conclude that my
>> > database
>> > isn't in utf8, but postgreSQL say no.
>>
>> If phpPgAdmin has the same issue, than that also implies there's
>> something getting messed up in your front end, that causing data to be
>> stored differently than you expect. Both pgAdmin and phpPgAdmin have
>> been used for 10+ years by hundreds of thousands of people with UTF-8
>> data.
>>
>> > So, pgadmin and phpadmin use the same device to collect data ? And this
>> > is
>> > the way which wrong ?
>>
>> The only common thing between them is libpq - which is also used by
>> psql, pg_dump, pg_restore etc. It's even more tried and tested than
>> the admin tools, as every single PostgreSQL installation there is
>> relies on it.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PgAdmin on Windows - UTF8 and WIN1252

От
Guillaume Lelarge
Дата:
On Mon, 2012-12-17 at 13:54 +0000, Dave Page wrote:
> Guillaume, can you provide any input here please? I only have English
> systems to hand, so can't even properly test this.
> 

I won't be able to provide much more help on this. I used a french
Windows release, but didn't have any such issue. Probably because, back
then when I used a Windows PC, my unix PostgreSQL database used a
SQL_ASCII encoding (yeah, I know, really bad... it was 7 years ago...).

Anyway, never had big issue with encoding back then. When I use my
Windows XP on my laptop these days, I usually don't have text columns.

Sorry.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com




Re: PgAdmin on Windows - UTF8 and WIN1252

От
Vik Reykja
Дата:

On Mon, Dec 17, 2012 at 10:59 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Mon, 2012-12-17 at 13:54 +0000, Dave Page wrote:
> Guillaume, can you provide any input here please? I only have English
> systems to hand, so can't even properly test this.
>

I won't be able to provide much more help on this. I used a french
Windows release, but didn't have any such issue. Probably because, back
then when I used a Windows PC, my unix PostgreSQL database used a
SQL_ASCII encoding (yeah, I know, really bad... it was 7 years ago...).

Anyway, never had big issue with encoding back then. When I use my
Windows XP on my laptop these days, I usually don't have text columns.

Sorry.

I use pgAdmin on a French Windows and have never had any problems related to encoding.

Re: PgAdmin on Windows - UTF8 and WIN1252

От
Vik Reykja
Дата:
Please do not top post. If you're using gmail's new reply interface, click on the "..." to reply inline.

On Tue, Dec 18, 2012 at 12:28 PM, Baptiste GONOD <baptiste.gonod@gmail.com> wrote:
Can you just create a database UTF8 and say me the psql -l return ? To see if you have windows.1252 on collate.

I wouldn't have that because my server is linux so my collation is en_US.UTF8.  I just tested on a French Windows server and the collation is "French, France"
 
More, if you have an application UTF8, test to insert data (with char as "é € à"...) then open pgadmin to consult them.
For me : "é à  €" give "é à  €". utf8 is encoded in 1252. You can replicate that with notepadd++ typing "é à  €", convert to utf8, then encoded in ANSI (or 1252 the same things).

This works as desired for me.

Re: PgAdmin on Windows - UTF8 and WIN1252

От
Baptiste GONOD
Дата:
Can you just create a database UTF8 and say me the psql -l return ? To see if you have windows.1252 on collate.

More, if you have an application UTF8, test to insert data (with char as "é € à"...) then open pgadmin to consult them.
For me : "é à  €" give "é à  €". utf8 is encoded in 1252. You can replicate that with notepadd++ typing "é à  €", convert to utf8, then encoded in ANSI (or 1252 the same things).

Thanks for your time.


2012/12/18 Vik Reykja <vikreykja@gmail.com>

On Mon, Dec 17, 2012 at 10:59 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Mon, 2012-12-17 at 13:54 +0000, Dave Page wrote:
> Guillaume, can you provide any input here please? I only have English
> systems to hand, so can't even properly test this.
>

I won't be able to provide much more help on this. I used a french
Windows release, but didn't have any such issue. Probably because, back
then when I used a Windows PC, my unix PostgreSQL database used a
SQL_ASCII encoding (yeah, I know, really bad... it was 7 years ago...).

Anyway, never had big issue with encoding back then. When I use my
Windows XP on my laptop these days, I usually don't have text columns.

Sorry.

I use pgAdmin on a French Windows and have never had any problems related to encoding.