in reply to Re^2: Encoding problem
in thread Encoding problem
It depends whether the data is double encoded, or whether you different encodings are used for different parts of the file. Thus my request for a sample of the file. I suspect the latter.
Using :encoding twice (assuming it works at all) would only help the former case. The order for decoding would be the opposite order used for encoding.
The latter case would involve looking at each byte or group of bytes and making guesses.
PS — Don't use UTF8 (an encoding known only to Perl) when decoding. That leaves you open to a vulnerability. Use UTF-8 instead.
Update: Using :encoding twice doesn't always work if ever. You'll need to use decode($enc1, decode($enc2, $_)) if your text is double-encoded.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Encoding problem
by grscott (Novice) on May 08, 2009 at 19:34 UTC | |
by ikegami (Patriarch) on May 08, 2009 at 20:08 UTC |