hi
i am using activestate perl 5.10 with perl/tk 804.027 on windows xp
in the following code (just a form with a menu and two submenus:
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use utf8;
use encoding 'cp1256';
use Encode qw(encode decode);
my $mw = tkinit;
my $menubar = $mw->Menu(-type => 'menubar');
$mw->configure(-menu => $menubar);
my $text1 = encode( 'utf8','ملف'); #arabic word for file
my $text2 = encode( 'utf8','فتح'); # arabic word for open
my $text3 = encode( 'utf8','تسجيل'); # arabic word for save
my $menu = $menubar->cascade(-label => $text1);
$menu->command(-label => $text2);
$menu->command(-label => $text3);
MainLoop;
__END__
the arabic letters in $text2 and $text3 are displayed correctly in arabic, while $text1 is displayed as unicode numbers and not arabic letters ie the label of the main menu is displayed as:
\x{0645}\x{0644}\x{0641}
what should i do?
why the label of a submenu displayed correctly as letters while the label of the main menu displayed as unicode numbers?
thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.