/[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.3 by wakaba, Mon Sep 16 02:20:18 2002 UTC revision 1.4 by wakaba, Mon Sep 16 06:35:16 2002 UTC
# Line 254  sub new_object { Line 254  sub new_object {
254                  Gdesignation    => "\x42",      ## F of designation or 0                  Gdesignation    => "\x42",      ## F of designation or 0
255                  Ginvoke => 1,                  Ginvoke => 1,
256          },          },
257            undef_char      => ["\x3F", {type => 'G94', charset => 'B'}],
258          use_revision    => 1,   ## Output IRR          use_revision    => 1,   ## Output IRR
259    };    };
260    \%C;    \%C;
# Line 571  sub internal_to_iso2022 ($\%) { Line 572  sub internal_to_iso2022 ($\%) {
572      if (defined $t) {      if (defined $t) {
573        $r .= $t;        $r .= $t;
574      } else {      } else {
575        $r .= _i2g ("\x3F", $C, type => 'G94', charset => 'B');        $r .= _i2g ($C->{option}->{undef_char}->[0], $C,
576                      %{ $C->{option}->{undef_char}->[1] });
577      }      }
578    }    }
579    $r . _back2ascii ($C);    $r . _back2ascii ($C);
# Line 625  sub _i2c ($%%) { Line 627  sub _i2c ($%%) {
627  sub _i2g ($%%) {  sub _i2g ($%%) {
628    my ($s, $C, %O) = @_;    my ($s, $C, %O) = @_;
629    my $r = '';    my $r = '';
630    my $set = $CHARSET{$O{type}}->{$O{charset}};    my $set = $CHARSET{$O{type}}->{$O{charset}.
631        ($O{revision}&&$C->{option}->{use_revision}?$O{revision}:'')};
632    my $set0 = $CHARSET{$O{type}}->{$O{charset_id}};    my $set0 = $CHARSET{$O{type}}->{$O{charset_id}};
633    ## -- designate character set    ## -- designate character set
634    my $G = 0;    my $G = 0;
# Line 679  sub _i2g ($%%) { Line 682  sub _i2g ($%%) {
682        } elsif ($C->{C0}->{'C_SS'.$G}) {        } elsif ($C->{C0}->{'C_SS'.$G}) {
683          $r .= _i2c ($C->{C0}->{'C_SS'.$G}, $C, type => 'C0') || return undef;          $r .= _i2c ($C->{C0}->{'C_SS'.$G}, $C, type => 'C0') || return undef;
684        } else {  ## Both C0 and C1 set do not have SS2/3.        } else {  ## Both C0 and C1 set do not have SS2/3.
685            $left = 0 if $G == 1 && !$C->{C0}->{C_LS1};
686          $r .= __invoke ($C, $G => $left) if $C->{$left?'GL':'GR'} ne 'G'.$G;          $r .= __invoke ($C, $G => $left) if $C->{$left?'GL':'GR'} ne 'G'.$G;
687        }        }
688      } else {      } else {
# Line 755  ISO/IEC 8859, "8-Bit Single-Byte Coded G Line 759  ISO/IEC 8859, "8-Bit Single-Byte Coded G
759    
760  Encode, perlunicode  Encode, perlunicode
761    
762    =head1 TODO
763    
764    =over 4
765    
766    =item NCR (coding system other than ISO/IEC 2022) support
767    
768    =over 2
769    
770    =item ESC 02/05 02/15 03/x of X Compound Text
771    
772    =back
773    
774    =item Output of control character sets, single control functions
775    
776    =item Designation sequence of control character sets (input)
777    
778    =item Special graphic character sets such as G3 of EUC-TW
779    
780    =item SUPER SHIFT (SS) invoke function of old control character set
781    
782    =item Safe transparent of control string (ISO/IEC 6429)
783    
784    =item Output of unoutputable characters as alternative notation such as SGML-like entity
785    
786    =item C0 set invoked to CR area like ISIRI code
787    
788    Really need?
789    
790    =item special treatment of 0x20, 0x7E, 0xA0, 0xFF
791    
792    For example, GB mongolian sets use MSP (MONGOLIAN SPACE)
793    with these code positions.
794    
795    And, no less coding systems does not use (or does ban using) DEL.
796    
797    =item A lot of character sets don't have pseudo-UCS mapping.
798    
799    Most of 9m^n (n >= 3) sets, 9m^n sets with I byte, 9m^n
800    DRCSes do not have pseudo-UCS mapping area.  It is
801    questionable to allocate lots of code positions to these
802    rarely-(or no-)used character sets.
803    
804    =item Even character sets that have pseudo-UCS mapping, some of them can't be outputed in ISO/IEC 2022.
805    
806    Because output of rarely-used character sets is
807    not implemented yet.
808    
809    =back
810    
811  =head1 LICENSE  =head1 LICENSE
812    
813  Copyright 2002 wakaba <w@suika.fam.cx>  Copyright 2002 wakaba <w@suika.fam.cx>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24