cr8josh has asked for the wisdom of the Perl Monks concerning the following question:
Greetings
I am using Perl and Tk to read text from a .txt file (Dos/Windows ANSI) and display it, edit it and save it back to a .txt file. The file is in French, and contains the character œ. The œ will not show up in the TK window (it disappears), but when I save the text back out, it shows up in the saved txt file. So, it seems to be there, just not be displayed. I wonder if it may be a font issue (?) but I've tried many standard fonts: courier, Arial, helvetica. I am already changing the system's Locale to French. Any thoughts? I want to avoid Unicode if possible.
Thanks in advance
Here's some sample code:
use warnings; use strict; use Tk; use Tk::TextUndo; my $main = MainWindow->new; my $middle = $main->Frame(-borderwidth=>2,-relief=>'groove')->grid(-ro +w=>0,-column=>1,-sticky=>'nsew'); my $middlebox = $middle->TextUndo ( -font => 'arial 10', -wrap => 'word', -spacing2 => 10, -spacing3 => 30, -takefocus => 1, -background => 'white', -width => 70, -height => 10, )->grid(-row=>0, -column=>0, -sticky=>'nsew +'); $middlebox->insert('end',"This is a test of the œ character"); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl TK character disappearingue
by zentara (Cardinal) on Jun 26, 2012 at 21:51 UTC | |
by cr8josh (Sexton) on Jun 27, 2012 at 15:55 UTC | |
by zentara (Cardinal) on Jun 27, 2012 at 17:21 UTC | |
by Anonymous Monk on Jun 27, 2012 at 17:32 UTC | |
by zentara (Cardinal) on Jun 27, 2012 at 17:44 UTC | |
| |
by cr8josh (Sexton) on Jun 27, 2012 at 22:37 UTC | |
|
Re: Perl TK character disappearing
by zentara (Cardinal) on Jun 27, 2012 at 19:52 UTC | |
by cr8josh (Sexton) on Jun 27, 2012 at 22:29 UTC | |
by choroba (Cardinal) on Jun 27, 2012 at 23:24 UTC | |
by cr8josh (Sexton) on Jun 28, 2012 at 00:00 UTC |