Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > encoding problem on Tk entry widget

Reply
Thread Tools

encoding problem on Tk entry widget

 
 
filippo
Guest
Posts: n/a
 
      05-17-2007
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

 
Reply With Quote
 
 
 
 
Ch Lamprecht
Guest
Posts: n/a
 
      05-17-2007
filippo wrote:
> 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

--
use Tk;use Tk::GraphItems;$c=tkinit->Canvas->pack;push@i,Tk::GraphItems->
TextBox(text=>$_,canvas=>$c,x=>$x+=70,y=>100)for(J ust=>another=>Perl=>Hacker);
Tk::GraphItems->Connector(source=>$i[$_],target=>$i[$_+1])for(0..2);
$c->repeat(30,sub{$_->move(0,4*cos($d+=3.16))for(@i)});MainLoop
 
Reply With Quote
 
 
 
 
filippo
Guest
Posts: n/a
 
      05-18-2007
On 17 Mag, 10:45, Ch Lamprecht <(E-Mail Removed)> wrote:

> 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 (utf.

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

 
Reply With Quote
 
Ch Lamprecht
Guest
Posts: n/a
 
      05-18-2007
filippo wrote:
> On 17 Mag, 10:45, Ch Lamprecht <(E-Mail Removed)> 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 (utf.
>
> 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


--
use Tk;use Tk::GraphItems;$c=tkinit->Canvas->pack;push@i,Tk::GraphItems->
TextBox(text=>$_,canvas=>$c,x=>$x+=70,y=>100)for(J ust=>another=>Perl=>Hacker);
Tk::GraphItems->Connector(source=>$i[$_],target=>$i[$_+1])for(0..2);
$c->repeat(30,sub{$_->move(0,4*cos($d+=3.16))for(@i)});MainLoop
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Tkinter.event.widget: handler gets name instead of widget. Terry Reedy Python 15 07-16-2012 10:32 AM
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch Python 0 07-09-2012 08:39 PM
Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch Python 0 07-08-2012 09:19 PM
user interface widget: ordered selection list: do any UI library has this widget? zhangweiwu@realss.com Javascript 0 10-10-2006 01:02 AM
Entry Widget problem Marek S. Python 0 06-30-2006 09:40 AM



Advertisments