perl-unicode

Re: Big5 scalar needs to be UTF-8

2002-10-30 00:30:05
On Tue, Oct 29, 2002 at 02:54:32PM -0800, Tim Scott wrote:
The only hurdle I can't get started with is how to convert the Big5
scalar into UTF-8.

my $ustring = Encode::decode(big5 => $big5_string);

I've read various exciting things about how PERL5.8 can read a big5
stream from a file (using something like "< :encoding(big5)" in the
'open' call) but this doesn't help me to convert the scalar ... does
it ?

Well, it does, if you want to get unneccessariily fancy:

$ustring = do {
    local $/;
    open $fh, '<:encoding(big5)', \$big5_string;
    <$fh>;
}

/Autrijus/

Attachment: pgpkaTrtgoMnz.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>