Hello.

I try to use Encode.pm on perl 5.7.1
(v5.7.1 built for MSWin32-x86-multi-thread,
 Released on 10th April 2001)

but decode('shiftjis',$bytes)
(or other multibyte charset) doesn't work.

Though I don't know whether this problem has
already been settled, I (try to) fix this... 

The following is 'diff' for Encode/Tcl.pm.
=========================

113c113
<  my $rep = $obj->can("rep_$type");
---
>  my($rep, @leading);
124a125
>    $leading[$page] = 1 if $page;
134c135
<          my $uch = chr($val);
---
>          my $uch = pack('U', $val); # chr($val);
147a149,150
>  $rep = $type ne 'M' ? $obj->can("rep_$type") :
>    sub { ($_[0] > 255) || $leading[$_[0]] ? 'n' : 'C'};
160c163
< sub rep_M { ($_[0] > 255) ? 'n' : 'C' }
---
> #sub rep_M { ($_[0] > 255) ? 'n' : 'C' }
166c169
<  $obj-{'Rep'}->($ch);
---
>  $obj->{'Rep'}->($ch);

=========================

and I've check 'encode' and 'decode'
for 'shiftjis' and 'cp932' work.
(I found mapping of shiftjis.enc differs from
 that of Unicode's EASTASIA/JIS/SHIFTJIS.txt
 by 3 codepoints.)

Regards,
SADAHIRO Tomoyuki
E-mail: [EMAIL PROTECTED]
URL: http://homepage1.nifty.com/nomenclator/

Reply via email to