Andreas Fromm wrote:
> I need to store strings with non-english characters in my DB. I created
> my db with unicode encoding, but am not able to insert data into it from
> psql nor pgaccess, which seems not to suport non english characters at
> all.
template1=# create table test ( testcol varchar ) ;
CREATE TABLE
template1=# insert into test values ( 'föö bär' );
INSERT 154068 1
template1=# select * from test;
testcol
---------
föö bär
(1 row)
template1=# \! env | egrep LC\|LANG
LC_CTYPE=de_DE.ISO8859-1
As you can see, psql supports non-English characters fine.
However, psql respects your locale settings. So, if your
locale settings are wrong, it will default to the standard
C / POSIX locale, i.e. US-ASCII.
The correct setting depends on your operating system. In
my case (FreeBSD), I set the environment variable LC_CTYPE
to "de_DE.ISO8859-1". On Solaris you can try "iso_8859_1".
Regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"If you think C++ is not overly complicated, just what is a protected
abstract virtual base pure virtual private destructor, and when was the
last time you needed one?"
-- Tom Cargil, C++ Journal