perl-unicode

Re: Big5 scalar needs to be UTF-8

2002-10-30 07:30:04

Thank you for this.
I can't find the Encode module - do I need to upgrade
from PERL 5.6.0 or can I find a compatible version
somewhere ?

Thanks,
Tim

--- Autrijus Tang <autrijus(_at_)autrijus(_dot_)org> wrote:
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 part 2 application/pgp-signature 



__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

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