Front page | perl.beginners |
Postings from July 2012
Unicode question
Thread Next
From:
Manfred Lotz
Date:
July 12, 2012 11:09
Subject:
Unicode question
Message ID:
20120712200850.197073a5@arcor.com
Hi all,
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?
#! /usr/bin/perl
use strict;
use warnings;
use 5.010;
use utf8;
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";
--
Manfred
Thread Next
-
Unicode question
by Manfred Lotz