note
dstrom
<p>Sorry, my last post was unclear. I meant the program by grantm. Here is a clarified version:</p>
<p>
I am very grateful for your help. However, when I run the program below by grantm, I do not get the character '中', but rather the non-sensical "Σ╕¡". Any idea of what is going wrong? Thanks. (I have the East Asian language pack installed, so it is not simply that.)
</p>
<code>
#!/usr/bin/perl
use strict;
use warnings;
use Encode qw(decode);
my $ascii_hex = 'D6D0'; # continue for as many bytes as required
my $bytes = pack('H*', $ascii_hex);
my $character_string = decode('gb2312', $bytes);
binmode(STDOUT, ':utf8');
print $character_string, "\n";
</code>
908210
908354