perl-unicode

[Bug?] full-width '-' wouldn't be encoded to iso-2022-jp

2003-04-20 22:30:04
Hello, Dan-san. And hello to all.

# note: this mail body includes some Japanese characters.

I've found a problem about encoding from utf-8 to iso-2022-jp
with Encode module.

It seems that the full-width character '-' in Japanese UTF-8
would not be encoded to that of ISO-2022-JP. It will be encoded
to the string '\x{ff0d}'.

Isn't it a bug or my mis-scripting?

my script is: (this .pl file is saved as UTF-8)
--------------<cut here>-------------
use 5.008;
use strict;
use warnings;

use utf8;
use Encode;

my $body = '+/−漢字え焉扤\xA9kanjida+/-';

$body = encode('iso-2022-jp', $body);

print $body;
--------------<cut here>-------------

I got result of the script: (escape is trascribed to [ESC])
[ESC]$B!\!?[ESC](B\x{ff0d}[ESC]$B4A;z$(_at_)[ESC](Bkanjida+/-

my environment is:
ActivePerl v5.8.0.806 on Windows98(J)
Encode v1.92

Thank you.

-- 
Masanori HATA
<lovewing(_at_)geocities(_dot_)co(_dot_)jp>
He's always with us!

<Prev in Thread] Current Thread [Next in Thread>
  • [Bug?] full-width '-' wouldn't be encoded to iso-2022-jp, lovewing <=