Thread: Encoding problem
Hi, when I enter the following SELECT into psql select * from mytable where data like '%ü%' I get a selection of a couple of rows. The problem is that alls the "ü" characters get displayed as "<FC>". Why is that so? fritz BTW: I set client encoding to latin1 and the database stores data in utf8 and I'm running postgresql under the following system: PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.95.4
Fritz Bayer wrote: > Hi, > > when I enter the following SELECT into psql > select * from mytable where data like '%ü%' > I get a selection of a couple of rows. > The problem is that alls the "ü" characters get displayed as "<FC>". > > Why is that so? Probably something in your terminal setup. I always have endless trouble with accented characters on the different systems I use. > fritz > > BTW: I set client encoding to latin1 and the database stores data in > utf8 and > I'm running postgresql under the following system: PostgreSQL 7.2.1 on > i686-pc-linux-gnu, compiled by GCC 2.95.4 You should upgrade to the most recent 7.2.x version immediately, and I'd recommend 8.0.x as soon as possible. -- Richard Huxton Archonet Ltd
Fritz Bayer schrob: > The problem is that alls the "ü" characters get displayed as "<FC>". > > Why is that so? This could happen when your locale isn't properly set up. If, for example, LC_CTYPE is set to C, your pager thinks this character isn't printable and tries to do something smart with it. You can display the current setup by running "locale". Does it work when you export LC_CTYPE=de_DE before running psql? regards, Andreas
seltenreich@gmx.de (Andreas Seltenreich) wrote in message news:<877jixorpl.fsf@gate450.dyndns.org>... > Fritz Bayer schrob: > > > The problem is that alls the "ü" characters get displayed as "<FC>". > > > > Why is that so? > > This could happen when your locale isn't properly set up. If, for > example, LC_CTYPE is set to C, your pager thinks this character isn't > printable and tries to do something smart with it. You can display the > current setup by running "locale". > > Does it work when you export LC_CTYPE=de_DE before running psql? > I noticed that no locales have been generated and that the variable was set to C. I created the locales for LATIN1 and ISO8859-15 and set the variable to the value you suggested. I tried it and now I get ü instead. To give you more clues I checked the encoding which seems to be UNICODE. show client_encoding; NOTICE: Current client encoding is 'UNICODE' SHOW VARIABLE So I tried to set it to LATIN1 using \encoding latin1 But now I get select * from user_requests; ERROR: Could not convert UTF-8 to ISO8859-1 > regards, > Andreas > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq