LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-11-2005, 10:52 PM   #1
puedo
LQ Newbie
 
Registered: Feb 2005
Location: Texas USA
Distribution: Fedora
Posts: 4

Rep: Reputation: 0
Question printing Spanish accent characters in Perl/tk entry widget


I am writing a program that stores data in a MySQL database.
This is running on a fully updated Fedora Core 3 system.

Some of this data contains Spanish names like Jos Nuez.
I have a Perl/Tk Entry widget to work with the data.
I can type the accented characters into the Entry widget.
I can put it into the MySQL Database. (verified by logging into mysql and doing a select)
I can read it from the MySQL Database into a PERL variable.
I can print it to the console using print "$variable\n";

Writing the variable to the entry wiget causes a problem:
$variable = "Jos Nuez";
print "$variable\n"; # this works
$entryWidget->insert('0',$variable);

the Entry widget now displays:
José Nuñez

I have tried using
use Encode::Unicode; and a few others like that.

Anyone have any ideas?
 
Old 02-19-2005, 02:16 PM   #2
puedo
LQ Newbie
 
Registered: Feb 2005
Location: Texas USA
Distribution: Fedora
Posts: 4

Original Poster
Rep: Reputation: 0
Here is the answer:

use utf8;
$variable = "Jos Nuez";
print "$variable\n"; # this works
utf8::decode($variable);
$entryWidget->insert('0',$variable);

all the characters now display correctly in the entry Widget
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help regarding Entry widget kshebbar0802 Programming 3 08-25-2005 05:39 PM
Fedora Spanish Characters - a new twist: mySQL jjdoll42 Linux - Software 1 05-19-2005 03:28 PM
Question about accent characters, etc in Openoffice.org LaptopLinux Linux - Software 1 07-25-2004 10:57 PM
easy entry of international characters teacup LinuxQuestions.org Member Success Stories 1 07-02-2004 11:51 AM
Print Spanish Characters in Epson FX-850 blas Linux - General 0 01-29-2004 01:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration