Home > Archive > PERL Programming > October 2007 > Returns of Encode::decode / guess_encoding ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Returns of Encode::decode / guess_encoding ?
|
|
|
| Hello,
Does anyone know what's the return of Encode::decode(), guess_encoding(), and Encode::Guess->guess() ?
Like $my_guess = guess_encoding($mystring, qw/big5/);
die $my_guess unless ref($my_guess);
Then it prints out "big5-eten or cp936 at c:\myproject\....."
I want to catch this "big5-eten" and "cp936" word. So that I can use it to {try to} decode with it...
How Can I do that? Thanks
Thanks for everyone's help :)
| |
| Mumia W. 2007-10-02, 7:01 pm |
| On 10/02/2007 09:02 AM, 地球人 wrote:
> Hello,
>
> Does anyone know what's the return of Encode::decode(), guess_encoding(), and Encode::Guess->guess() ?
>
> Like $my_guess = guess_encoding($mystring, qw/big5/);
> die $my_guess unless ref($my_guess);
>
> Then it prints out "big5-eten or cp936 at c:\myproject\....."
>
> I want to catch this "big5-eten" and "cp936" word. So that I can use it to {try to} decode with it...
>
> How Can I do that? Thanks
>
>
> Thanks for everyone's help :)
>
According to the documentation for Encode::Guess,
Encode::decode("Guess",...) returns an anonymous subroutine if it
succeeds, and it returns a string error message if it fails.
The same is true of guess_encoding and Encode::Guess->guess.
|
|
|
|
|