cheerful has asked for the wisdom of the Perl Monks concerning the following question:
I have some image files which have unicode caption. I used ExifTool to extract them. However, I don't know how to output them to HTML file in their native encoding.
If I write them out without encoding (all output to STDOUT which is redirected to a file), the output can be viewed if charset is UTF-8. The font is ugly but correct.
However, if I try any of the following, I get garbage
I even tried decode('UTF-8', $text) before but it does not work either. What's the proper way to output in correct encoding/charset? Thanks!binmode(STDOUT, ":encoding(euc-cn)") binmode(STDOUT, ":encoding(gb2312)") or convert each individual string $text = encode('euc-cn', $text)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to encode for non-unicode output
by moritz (Cardinal) on Nov 04, 2008 at 19:36 UTC | |
by Anonymous Monk on Nov 05, 2008 at 11:31 UTC | |
by cheerful (Initiate) on Nov 05, 2008 at 14:55 UTC | |
by Anonymous Monk on Nov 05, 2008 at 15:07 UTC | |
by cheerful (Initiate) on Nov 05, 2008 at 14:16 UTC | |
by moritz (Cardinal) on Nov 05, 2008 at 15:55 UTC |