----- Original Message -----
From: Ang Sei Heng <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 1:27 AM
Subject: Need help on Unicode Programming...



> This is what I did:
> -------------- BEGIN -------------
> #!/usr/bin/perl -w
>
> use Unicode::Map8;
> use Unicode::String;
>
> MAIN:
> {
> my $m = Unicode::String->new;
I dont see a 'new' constructor mentioned in the documentation....

Here's a part of the fine manual on UTF...:

SYNOPSIS
 use Unicode::String qw(utf8 latin1 utf16);
 $u = utf8("The Unicode Standard is a fixed-width, uniform ");
 $u .= utf8("encoding scheme for written characters and text");
 # convert to various external formats
 print $u->ucs4;      # 4 byte characters
 print $u->utf16;     # 2 byte characters + surrogates
 print $u->utf8;      # 1-4 byte characters
 print $u->utf7;      # 7-bit clean format
 print $u->latin1;    # lossy
 print $u->hex;       # a hexadecimal string
 # all these can be used to set string value or as constructor
 $u->latin1("Å være eller å ikke være");
 $u = utf16("\0Å\0 \0v\0æ\0r\0e");
 # string operations
 $u2 = $u->copy;
 $u->append($u2);
 $u->repeat(2);
 $u->chop;
 $u->length;
 $u->index($other);
 $u->index($other, $pos);
 $u->substr($offset);
 $u->substr($offset, $length);
 $u->substr($offset, $length, $substitute);
 # overloading
 $u .= "more";
 $u = $u x 100;
 print "$u\n";
 # string <--> array of numbers
 @array = $u->unpack;
 $u->pack(@array);
 # misc
 $u->ord;
 $u = uchr($num);


Reply via email to