/[suikacvs]/perl/lib/Encode/ISO2022.pm
Suika

Diff of /perl/lib/Encode/ISO2022.pm

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

revision 1.7 by wakaba, Sun Sep 22 11:09:38 2002 UTC revision 1.8 by wakaba, Sat Oct 12 11:03:00 2002 UTC
# Line 346  sub internal_to_iso2022 ($\%) { Line 346  sub internal_to_iso2022 ($\%) {
346        $t = _i2g ($c, $C, type => 'G94', charset => 'B');        $t = _i2g ($c, $C, type => 'G94', charset => 'B');
347      } elsif ($cc <= 0x9F) {      } elsif ($cc <= 0x9F) {
348        $t = _i2c ($c, $C, type => 'C1', charset_id => '64291991C1',        $t = _i2c ($c, $C, type => 'C1', charset_id => '64291991C1',
349          charset => $C->{private_set}->{XC1}->{'64291991C1'});          charset => $C->{option}->{private_set}->{XC1}->{'64291991C1'});
350      } elsif ($cc <= 0xFF) {      } elsif ($cc <= 0xFF) {
351        $t = _i2g (chr($cc-0x80), $C, type => 'G96', charset => 'A');        $t = _i2g (chr($cc-0x80), $C, type => 'G96', charset => 'A');
352      } elsif ($cc <= 0x24FF) {      } elsif ($cc <= 0x24FF) {
353        my $c = $cc - 0x100;        my $c = $cc - 0x100;
354        my $final = $C->{private_set}->{U96n}->[0];        my $final = $C->{option}->{private_set}->{U96n}->[0];
355        if (length $final) {        if (length $final) {
356          $t = _i2g (chr(($c / 96)+0x20).chr(($c % 96)+0x20), $C,          $t = _i2g (chr(($c / 96)+0x20).chr(($c % 96)+0x20), $C,
357            type => 'G96n', charset => $final);            type => 'G96n', charset => $final);
358        }        }
359      } elsif ($cc <= 0x33FF) {      } elsif ($cc <= 0x33FF) {
360        my $c = $cc - 0x2500;        my $c = $cc - 0x2500;
361        my $final = $C->{private_set}->{U96n}->[1];        my $final = $C->{option}->{private_set}->{U96n}->[1];
362        if (length $final) {        if (length $final) {
363          $t = _i2g (chr(($c / 96)+0x20).chr(($c % 96)+0x20), $C,          $t = _i2g (chr(($c / 96)+0x20).chr(($c % 96)+0x20), $C,
364            type => 'G96n', charset => $final);            type => 'G96n', charset => $final);
365        }        }
366      } elsif (0xE000 <= $cc && $cc <= 0xFFFF) {      } elsif (0xE000 <= $cc && $cc <= 0xFFFF) {
367        my $c = $cc - 0xE000;        my $c = $cc - 0xE000;
368        my $final = $C->{private_set}->{U96n}->[2];        my $final = $C->{option}->{private_set}->{U96n}->[2];
369        if (length $final) {        if (length $final) {
370          $t = _i2g (chr(($c / 96)+0x20).chr(($c % 96)+0x20), $C,          $t = _i2g (chr(($c / 96)+0x20).chr(($c % 96)+0x20), $C,
371            type => 'G96n', charset => $final);            type => 'G96n', charset => $final);
# Line 431  sub internal_to_iso2022 ($\%) { Line 431  sub internal_to_iso2022 ($\%) {
431      } elsif (0x70400000 <= $cc && $cc <= 0x7040FFED) {      } elsif (0x70400000 <= $cc && $cc <= 0x7040FFED) {
432        my $c = $cc - 0x70400000;        my $c = $cc - 0x70400000;
433        $t = _i2g (chr(($c % 94)+0x21), $C, charset_id => 'P'.int ($c / 94),        $t = _i2g (chr(($c % 94)+0x21), $C, charset_id => 'P'.int ($c / 94),
434            type => 'G94', charset => $C->{private_set}->{G94}->[ $c / 94 ]);            type => 'G94', charset => $C->{option}->{private_set}->{G94}->[ $c / 94 ]);
435      } elsif (0x70410000 <= $cc && $cc <= 0x7041FFBF) {      } elsif (0x70410000 <= $cc && $cc <= 0x7041FFBF) {
436        my $c = $cc - 0x70410000;        my $c = $cc - 0x70410000;
437        $t = _i2g (chr(($c % 96)+0x20), $C, charset_id => 'P'.int ($c / 96),        $t = _i2g (chr(($c % 96)+0x20), $C, charset_id => 'P'.int ($c / 96),
438            type => 'G96', charset => $C->{private_set}->{G96}->[ $c / 96 ]);            type => 'G96', charset => $C->{option}->{private_set}->{G96}->[ $c / 96 ]);
439      } elsif (0x70420000 <= $cc && $cc <= 0x7046F19B) {      } elsif (0x70420000 <= $cc && $cc <= 0x7046F19B) {
440        my $c = $cc % 0x10000;        my $c = $cc % 0x10000;
441        $t = _i2g (chr((($c % 8836) / 94)+0x21).chr(($c % 94)+0x21), $C,        $t = _i2g (chr((($c % 8836) / 94)+0x21).chr(($c % 94)+0x21), $C,
442            type => 'G94n',            type => 'G94n',
443            charset_id => 'P'.int(($cc / 0x10000) - 0x7042).'_'.int($c / 8836),            charset_id => 'P'.int(($cc / 0x10000) - 0x7042).'_'.int($c / 8836),
444            charset => $C->{private_set}->{G94n}->[ ($cc / 0x10000) - 0x7042 ]            charset => $C->{option}->{private_set}->{G94n}
445                         ->[ $c / 8836 ]);                         ->[ ($cc / 0x10000) - 0x7042 ]->[ $c / 8836 ]);
446      }      }
447      if (defined $t) {      if (defined $t) {
448        $t = _i2o ($t, $C, cs_F => "\x40")        $t = _i2o ($t, $C, cs_F => "\x40")
# Line 634  sub _i2o ($\%%) { Line 634  sub _i2o ($\%%) {
634    if ($CS ne $C->{coding_system}) {    if ($CS ne $C->{coding_system}) {
635      my $e = '';      my $e = '';
636      $e .= "\x1B\x25";      $e .= "\x1B\x25";
637      $e .= $O{cs_F} || $C->{private_set}->{coding_system}->{ $O{cs_id} }      $e .= $O{cs_F} || $C->{option}->{private_set}->{coding_system}->{ $O{cs_id} }
638            || return undef;            || return undef;
639      if ($C->{coding_system} eq $CODING_SYSTEM{"\x2F\x40"}      if ($C->{coding_system} eq $CODING_SYSTEM{"\x2F\x40"}
640       || $C->{coding_system} eq $CODING_SYSTEM{"\x2F\x43"}       || $C->{coding_system} eq $CODING_SYSTEM{"\x2F\x43"}

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24