/[pub]/test/oldencodeutils/lib/Encode/ISO2022.pm
Suika

Diff of /test/oldencodeutils/lib/Encode/ISO2022.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by wakaba, Wed Oct 16 10:39:35 2002 UTC revision 1.13 by wakaba, Mon Dec 16 10:25:01 2002 UTC
# Line 342  sub internal_to_iso2022 ($;%) { Line 342  sub internal_to_iso2022 ($;%) {
342    $C ||= &new_object;    $C ||= &new_object;
343        
344    my $r = '';    my $r = '';
345    for my $c (split //, $s) {    my @c = split //, $s;
346      my $cc = ord $c;  Encode::_utf8_off ($c);    for my $i (0..$#c) {
347        my $c = $c[$i]; my $cc = ord $c;  Encode::_utf8_off ($c);
348      my $t;      my $t;
349      if ($cc <= 0x1F) {      if ($cc <= 0x1F) {
350        $t = _i2c ($c, $C, type => 'C0', charset => '@');        $t = _i2c ($c, $C, type => 'C0', charset => '@');
# Line 452  sub internal_to_iso2022 ($;%) { Line 453  sub internal_to_iso2022 ($;%) {
453                         ->[ ($cc / 0x10000) - 0x7042 ]->[ $c / 8836 ]);                         ->[ ($cc / 0x10000) - 0x7042 ]->[ $c / 8836 ]);
454      }      }
455      if (defined $t) {      if (defined $t) {
456          ## Back to ISO/IEC 2022 if necessary
457        $t = _i2o ($t, $C, cs_F => "\x40")        $t = _i2o ($t, $C, cs_F => "\x40")
458