perl-unicode

Handling a utf8 string.

2000-04-29 02:00:32
Dear all,

# This mail is in UTF-8.

I have a question about handling a string of characters in UTF-8 on
Perl 5.6. I wrote a script quoted below:

#!perl -w
use utf8;
$a = '摩訶吠室&M004651;末那野提婆喝&M004651;闍陀羅尼儀軌';
$a =~ s{&M(\d\d\d)(\d\d\d);}
        {<IMG src="http://www.mojikyo.gr.jp/gif/$1/$1$2.gif";>}g;
print "$a\n";
__END__

This script results:

摩訶吠室<IMG src="http://www.mojikyo.gr.jp/gif/004/004651.gif";>末
那野提婆喝<IMG src="http://www.mojikyo.gr.jp/gif/004/004651.gif";>闍陀羅
尼儀軌

It seems to me that a string "摩訶吠室" has been changed into a
mysterious "摩訶吠室", although "末那野提婆喝" and "闍陀
羅尼儀軌" have been handled correctly.
Is this because of an incompleteness of Perl 5.6, or lack of my
understanding? Any suggestion and information will be helpful for me.

The version of Perl is:

  This is perl, v5.6.0 built for MSWin32-x86-multi-thread
  Binary build 613 provided by ActiveState Tool Corp.
  Built 12:36:25 Mar 24 2000

Thanks in advance,

Shigeki Moro
moro(_at_)ya(_dot_)sakura(_dot_)ne(_dot_)jp
http://www.ya.sakura.ne.jp/~moro/

<Prev in Thread] Current Thread [Next in Thread>
  • Handling a utf8 string., Shigeki Moro <=