encoding problem on Tk entry widget

F

filippo

I have a strange problem, probably due to encoding:

my database tables (postgresql) have Latin9 encoding and stores
italian names (a e i o u with accent). I can retrieve these names and
load into entry widgets but if I copy-back these into database (from
entry widgets just loaded), these letters change to strange not-ascii
char.

I would not be a database problem because if I print to video the sql
insert strings, these contains the altready corrupted words.

How can I solve this problem?

Thanks,
Filippo
 
C

Ch Lamprecht

filippo said:
I have a strange problem, probably due to encoding:

my database tables (postgresql) have Latin9 encoding and stores
italian names (a e i o u with accent). I can retrieve these names and
load into entry widgets but if I copy-back these into database (from
entry widgets just loaded), these letters change to strange not-ascii
char.

I would not be a database problem because if I print to video the sql
insert strings, these contains the altready corrupted words.

How can I solve this problem?

Thanks,
Filippo
Hi,

maybe a

$dh->do("SET client_encoding TO 'UTF8'");

could help.

Christoph
 
F

filippo

filippo wrote:

$dh->do("SET client_encoding TO 'UTF8'");


thanks today I will try it.

I understand that could be a encoding problem between db (latin9) and
windows (utf8).

I know it's of topic here, but do you know how can I convert my
database from LATIN9 to UTF8 to avoid such problems?

Thanks,

Filippo
 
C

Ch Lamprecht

filippo said:
thanks today I will try it.

I understand that could be a encoding problem between db (latin9) and
windows (utf8).

I know it's of topic here, but do you know how can I convert my
database from LATIN9 to UTF8 to avoid such problems?

Thanks,

Filippo
Hi,

you won't have problems if you set your client_encoding to something your client
can handle. However, if you want to convert your database encoding, you will
have to dump the database (using pg_dump), recreate it with encoding set to UTF8
(CREATE DATABASE your_database_name WITH ENCODING = 'UTF8') and restore from
your backup file (using psql).

HTH, Christoph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top