I have a simple question which I do not know how to solve in Perl. I know how to convert from utf-8 to GBK, for example, from e4b8ad
to d6d0
. But I am not sure how to go backward, i.e. given d6d0
, how do I know e4b8ad
.
Please enlighten me! Many thanks.
The answer to the question asked:
or
However, a more normal flow looks like the following:
Encode::HanExtra must be installed for Encode to find the encoding.
You can also normally specify the encoding when you open or close a FD and it will perform necessary conversions.
Works like a charm:
When you have hex digits, pack is your friend. Following is a REPL session. Notes: