Re: Print Spanish characters in Perl?
- From: "Peter J. Holzer" <hjp-usenet2@xxxxxx>
- Date: Sun, 29 Jun 2008 11:56:34 +0200
On 2008-06-21 00:12, Ben Bullock <benkasminbullock@xxxxxxxxx> wrote:
On Fri, 20 Jun 2008 04:37:34 +0000, Jürgen Exner wrote:
DanB <dbxxxxxxx@xxxxxxxxx> wrote:
I am trying to build a set of Spanish flash cards using TK, and I
need to be able to display the accented characters. I know that I
need to specify them in some unicode besides utf-8,
Actually, you don't. Just put them into your code in your favourite
editor and treat them like any ASCII character.
I suggest *not* doing this, but
use utf8;
and ensure that your file is saved in the UTF-8 format.
I fully agree with that.
[...]
and always specify the output encoding you want:
Since the OP wrote that he's using Perl/Tk, this shouldn't be necessary
- Perl/Tk should know how to display characters in perls internal
encoding. I expanded smallpond's script a bit:
#!/usr/bin/perl
use utf8;
use Tk;
my $win = new MainWindow(-title=>"Cómo está?");
my $frm = $win->Frame(-background => 'blue')->pack(-side => 'top');
my $label = $frm->Label(-text => '¡Hola!')->pack(-side => 'left');
my $label = $frm->Label(-text => 'Cómo está?')->pack(-side => 'left');
my $label = $frm->Label(-text => '75 €')->pack(-side => 'left');
MainLoop;
__END__
and it works fine for me. (I don't normally use Perl/Tk, so there may be
some gotchas I'm not aware of)
hp
.
- References:
- Print Spanish characters in Perl?
- From: DanB
- Re: Print Spanish characters in Perl?
- From: Jürgen Exner
- Re: Print Spanish characters in Perl?
- From: Ben Bullock
- Print Spanish characters in Perl?
- Prev by Date: FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?
- Next by Date: Re: How to make list of all htm file...
- Previous by thread: Re: Print Spanish characters in Perl?
- Next by thread: Re: Print Spanish characters in Perl?
- Index(es):
Relevant Pages
|