Parent Directory
|
Revision Log
2002-09-20 Wakaba <w@suika.fam.cx> * ISO2022.pm: - (iso2022_to_internal): New function. - (_iso2022_to_internal): Renamed from iso2022_to_internal. - (iso2022_to_internal): Experimental support of DOCS. - (internal_to_iso2022): Output in UCS coding systems if the character is unable to be encoded in ISO/IEC 2022 coded character sets. - (_i2o): New procedure. - ($C->{option}->{designate_to}->{coding_system}): New option property object. - ($C->{coding_system}): New property. - (%CODING_SYSTEM): New hash. (Alias to Encode::Charset's one.) * Charset.pm (make_initial_coding_system): Set 'reset_state' property with 1 value to coding systems of DOCS with 02/14 I byte.
| 1 | wakaba | 1.1 | require 5.7.3; |
| 2 | package Encode::Unicode::UTF7; | ||
| 3 | use strict; | ||
| 4 | use vars qw(%OPTION $VERSION); | ||
| 5 | wakaba | 1.3 | $VERSION=do{my @r=(q$Revision: 1.2 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; |
| 6 | wakaba | 1.1 | use base qw(Encode::Encoding); |
| 7 | require MIME::Base64; | ||
| 8 | wakaba | 1.2 | __PACKAGE__->Define (qw/utf-7 utf7 unicode-2-0-utf-7 unicode-2-0-utf7 x-unicode-2-0-utf7 cp65000 unicode-1-1-utf-7 csunicode11utf7/); |
| 9 | wakaba | 1.1 | ## BUG: Unicode-1-1-UTF-7 is actually not suitable. (We need Unicode 1.1 support.) |
| 10 | |||
| 11 | $OPTION{encode_o_set} = 1; | ||
| 12 | |||
| 13 | sub encode ($$;$) { | ||
| 14 | my ($obj, $str, $chk) = @_; | ||
| 15 | my $encode_reg = qr#[^\x09\x0A\x0D\x20A-Za-z0-9'(),-./:?]#; | ||
| 16 | $encode_reg = qr~[^\x09\x0A\x0D\x20A-Za-z0-9'(),-./:?!"#\$%&*;<=>@\[\]^_`{|}]~ | ||
| 17 | unless $OPTION{encode_o_set}; |