Thread: PgAdmin on Windows - UTF8 and WIN1252
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 />
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
[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
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
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
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_connector odbc connection.<br /><br />PgAdmin is a front-end too, not ?! And it's pgadmin that doesn't display data inutf8. All is encoded in WIN1252 whereas all settings are utf8/unicode in all options.<br /> More, phppgadmin has the sameproblem. So we could conclude that my database isn't in utf8, but postgreSQL say no.<br /><br />So, pgadmin and phpadminuse the same device to collect data ? And this is the way which wrong ?<br /><br />I don't understand.. ^^'<br /><divclass="gmail_extra"><br /><br /><div class="gmail_quote">2012/12/14 Dave Page <span dir="ltr"><<a href="mailto:dpage@pgadmin.org"target="_blank">dpage@pgadmin.org</a>></span><br /><blockquote class="gmail_quote" style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Dec 14, 2012 at 10:26 AM, BaptisteGONOD<br /> <<a href="mailto:baptiste.gonod@gmail.com">baptiste.gonod@gmail.com</a>> wrote:<br /> > <[Please keep replies on the mailing list]<br /> >> Someone give me <a href="mailto:pgadmin-support@postgresql.org">pgadmin-support@postgresql.org</a>so where do I must post ?<br /> >> Sendto the same mail ?<br /><br /></div>To <a href="mailto:pgadmin-support@postgresql.org">pgadmin-support@postgresql.org</a>.Just hit Reply All, so the list is CC'd.<br/><div class="im"><br /> > < I'm talking about whatever application you've got that's running on top of<br/> > PostgreSQL.<br /> >> What kind of app ?? Can you give me an example, because I don't see what<br /> >>app can run in front of postgre ! :O<br /><br /></div>Virtually noone will run PostgreSQL without an app in frontof it.<br /> That might be a website, an ERP system or something like Drupal or<br /> MediaWiki. The whole product isdesigned to sit behind an application<br /> of some sort.<br /><div class="HOEnZb"><div class="h5"><br /> --<br /> DavePage<br /> Blog: <a href="http://pgsnake.blogspot.com" target="_blank">http://pgsnake.blogspot.com</a><br /> Twitter:@pgsnake<br /><br /> EnterpriseDB UK: <a href="http://www.enterprisedb.com" target="_blank">http://www.enterprisedb.com</a><br/> The Enterprise PostgreSQL Company<br /></div></div></blockquote></div><br/></div>
< You said your database was UTF-8. So where does WIN1252 come into this? If the database is in UTF-8, pgAdmin uses UTF-8internally, there should never be any WIN1252 involved at all.<br /><br />><br />when I install postgreSQL or createmy 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 :<br /><br />initdb --locale French_France.UTF8 -D "..."<br />initdb --encodingutf8 --locale French_France -D "..."<br />initdb --encoding utf8 --locale utf8 -D "..."<br />...<br />or somethingelse about utf8, system says that the locale isn't know and set default to french_france.1252.<br /><br />And whenI look data with pgadmin, there's a conversion utf8 to WIN1252 of my data (on display, not in stored).<br /><br />Atthe install of postgreSQL, it ask the locales. Do I must choose another choice of French ?<br /><div class="gmail_extra"><br/><br /><div class="gmail_quote">2012/12/14 Dave Page <span dir="ltr"><<a href="mailto:dpage@pgadmin.org"target="_blank">dpage@pgadmin.org</a>></span><br /><blockquote class="gmail_quote" style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Dec 14, 2012 at 10:46 AM, BaptisteGONOD<br /> <<a href="mailto:baptiste.gonod@gmail.com">baptiste.gonod@gmail.com</a>> wrote:<br /> > Ok that'sa front-end. My problem isn't with my website.. he's work fine in<br /> > utf8 with postgreSQL in utf8 - testedwith pg_connect or odbc connection.<br /><br /></div>OK.<br /><div class="im"><br /> > PgAdmin is a front-end too,not ?! And it's pgadmin that doesn't display<br /> > data in utf8. All is encoded in WIN1252 whereas all settingsare<br /> > utf8/unicode in all options.<br /><br /></div>You said your database was UTF-8. So where does WIN1252come into<br /> this? If the database is in UTF-8, pgAdmin uses UTF-8 internally,<br /> there should never be anyWIN1252 involved at all.<br /><div class="im"><br /> > More, phppgadmin has the same problem. So we could concludethat my database<br /> > isn't in utf8, but postgreSQL say no.<br /><br /></div>If phpPgAdmin has the same issue,than that also implies there's<br /> something getting messed up in your front end, that causing data to be<br /> storeddifferently than you expect. Both pgAdmin and phpPgAdmin have<br /> been used for 10+ years by hundreds of thousandsof people with UTF-8<br /> data.<br /><div class="im"><br /> > So, pgadmin and phpadmin use the same device tocollect data ? And this is<br /> > the way which wrong ?<br /><br /></div>The only common thing between them is libpq- which is also used by<br /> psql, pg_dump, pg_restore etc. It's even more tried and tested than<br /> the admin tools,as every single PostgreSQL installation there is<br /> relies on it.<br /><div class="HOEnZb"><div class="h5"><br />--<br /> Dave Page<br /> Blog: <a href="http://pgsnake.blogspot.com" target="_blank">http://pgsnake.blogspot.com</a><br/> Twitter: @pgsnake<br /><br /> EnterpriseDB UK: <a href="http://www.enterprisedb.com"target="_blank">http://www.enterprisedb.com</a><br /> The Enterprise PostgreSQL Company<br/></div></div></blockquote></div><br /></div>
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
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
<br /><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 17, 2012 at 10:59 PM, Guillaume Lelarge <span dir="ltr"><<ahref="mailto:guillaume@lelarge.info" target="_blank">guillaume@lelarge.info</a>></span> wrote:<br /><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 2012-12-17at 13:54 +0000, Dave Page wrote:<br /> > Guillaume, can you provide any input here please? I only have English<br/> > systems to hand, so can't even properly test this.<br /> ><br /><br /> I won't be able to provide muchmore help on this. I used a french<br /> Windows release, but didn't have any such issue. Probably because, back<br />then when I used a Windows PC, my unix PostgreSQL database used a<br /> SQL_ASCII encoding (yeah, I know, really bad...it was 7 years ago...).<br /><br /> Anyway, never had big issue with encoding back then. When I use my<br /> WindowsXP on my laptop these days, I usually don't have text columns.<br /><br /> Sorry.<br /></blockquote></div><br />Iuse pgAdmin on a French Windows and have never had any problems related to encoding.<br /><br /></div>
Please do not top post. If you're using gmail's new reply interface, click on the "..." to reply inline.
This works as desired for me.
On Tue, Dec 18, 2012 at 12:28 PM, Baptiste GONOD <baptiste.gonod@gmail.com> wrote:
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"
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.
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.2012/12/18 Vik Reykja <vikreykja@gmail.com>
I use pgAdmin on a French Windows and have never had any problems related to encoding.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.