Front page | perl.beginners |
Postings from July 2012
From: Manfred Lotz
July 12, 2012 11:09
Message ID: email@example.com
Perhaps this is a stupid question. Anyway.
The following code works fine. However, I like to know how to retrieve
the UTF-8 hex representation of $uchar which is x'e0a487'. This is the
internal representation in Perl, so it should be possible to print it
out. Is there any function or module I could use to do this?
binmode STDOUT, ':utf8';
# this is code point U+0907, its name is
# DEVANAGARI LETTER I
# its utf8 hex representation is x'e0a487'
my $uchar = 'इ';
# this is 1
my $len = length $uchar;
say "Length of $uchar is $len";
by Manfred Lotz