I18N-Charset-1.419/0000755000175000017500000000000014006315244013143 5ustar martinmartinI18N-Charset-1.419/inc/0000755000175000017500000000000014006315244013714 5ustar martinmartinI18N-Charset-1.419/inc/Module/0000755000175000017500000000000014006315244015141 5ustar martinmartinI18N-Charset-1.419/inc/Module/Install.pm0000644000175000017500000002714514006312575017122 0ustar martinmartin#line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.19'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS'; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( {no_chdir => 1, wanted => sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($File::Find::name); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }}, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. I18N-Charset-1.419/inc/Module/Install/0000755000175000017500000000000014006315244016547 5ustar martinmartinI18N-Charset-1.419/inc/Module/Install/Win32.pm0000644000175000017500000000340314006312575020013 0ustar martinmartin#line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; I18N-Charset-1.419/inc/Module/Install/WriteAll.pm0000644000175000017500000000237614006312575020644 0ustar martinmartin#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; I18N-Charset-1.419/inc/Module/Install/Can.pm0000644000175000017500000000640514006312575017617 0ustar martinmartin#line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; if ($^O eq 'VMS') { require ExtUtils::CBuilder; my $builder = ExtUtils::CBuilder->new( quiet => 1, ); return $builder->have_compiler; } my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 245 I18N-Charset-1.419/inc/Module/Install/Fetch.pm0000644000175000017500000000462714006312575020153 0ustar martinmartin#line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; I18N-Charset-1.419/inc/Module/Install/Metadata.pm0000644000175000017500000004330214006312575020633 0ustar martinmartin#line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; I18N-Charset-1.419/inc/Module/Install/Base.pm0000644000175000017500000000214714006312575017767 0ustar martinmartin#line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.19'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 I18N-Charset-1.419/inc/Module/Install/Makefile.pm0000644000175000017500000002743714006312575020643 0ustar martinmartin#line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 I18N-Charset-1.419/t/0000755000175000017500000000000014006315244013406 5ustar martinmartinI18N-Charset-1.419/t/utf8.t0000644000175000017500000000606114006314557014472 0ustar martinmartin # utf8.t - tests for Unicode::MapUTF8 functionality of I18N::Charset use strict; use IO::Capture::Stderr; use Test::More; BEGIN { use_ok('I18N::Charset'); } my $oICS = new IO::Capture::Stderr; # These should fail gracefully: my @aa; ok(!defined umu8_charset_name(), q{}); # no argument ok(!defined umu8_charset_name(undef), q{}); # undef argument ok(!defined umu8_charset_name(q{}), q{}); # empty argument ok(!defined umu8_charset_name('junk'), q{}); # illegal code ok(!defined umu8_charset_name(\@aa), q{}); # illegal argument SKIP: { skip 'Unicode::MapUTF8 is not installed', 16 unless eval 'require Unicode::MapUTF8'; SKIP: { skip 'Unicode::MapUTF8 version is too old (1.09 is good)', 16 unless eval '(1.08 < ($Unicode::MapUTF8::VERSION || 0))'; # Plain old IANA names: is(umu8_charset_name('Unicode-2-0-utf-8'), 'utf8', 'Unicode-2-0-utf-8'); is(umu8_charset_name('UCS-2'), 'ucs2', 'UCS-2'); is(umu8_charset_name('U.C.S. 4'), 'ucs4', 'U.C.S. 4'); SKIP: { skip 'Unicode::Map is not installed', 2 unless eval 'require Unicode::Map'; # Unicode::Map aliases: # Unicode::Map names with dummy mib: is(umu8_charset_name('Adobe Ding Bats'), 'ADOBE-DINGBATS', 'Adobe Ding Bats'); is(umu8_charset_name('M.S. Turkish'), 'MS-TURKISH', 'M.S. Turkish'); } # SKIP block for Unicode::Map8 module SKIP: { skip 'Unicode::Map8 is not installed', 7 unless eval 'require Unicode::Map8'; # Unicode::Map8 aliases: is(umu8_charset_name('Windows-1-2-5-1'), 'cp1251', 'windows-1-2-5-1'); is(umu8_charset_name('windows-1252'), 'cp1252', 'windows-1252 eq'); is(umu8_charset_name('win-latin-1'), 'cp1252', 'win-latin-1'); isnt(umu8_charset_name('windows-1252'), 'cp1253', 'windows-1252 ne'); is(umu8_charset_name('windows-1253'), 'cp1253', 'windows-1253'); # Unicode::Map8 names with dummy mib: my $sInput = 'Adobe Zapf Ding Bats'; my $sExpect = 'Adobe-Zapf-Dingbats'; $oICS->start; my $sActual = umu8_charset_name($sInput); $oICS->stop; if (! is($sActual, $sExpect, $sInput)) { diag(@I18N::Charset::asMap8Debug); my @as = $oICS->read; diag(@as); } # if $sInput = ' c p 1 0 0 7 9 '; $sExpect = 'cp10079'; $oICS->start; $sActual = umu8_charset_name($sInput); $oICS->stop; if (! is($sActual, $sExpect, $sInput)) { diag(@I18N::Charset::asMap8Debug); my @as = $oICS->read; diag(@as); } # if } # SKIP block for Unicode::Map8 module SKIP: { skip 'Jcode is not installed', 4 unless eval 'require Jcode'; is(umu8_charset_name('Shift_JIS'), 'sjis', 'Shift_JIS'); is(umu8_charset_name('sjis'), 'sjis', 'sjis'); is(umu8_charset_name('x-sjis'), 'sjis', 'x-sjis'); is(umu8_charset_name('x-x-sjis'), 'sjis', 'x-x-sjis'); } # SKIP block for Jcode module } # SKIP block for VERSION of Unicode::MapUTF8 module } # SKIP block for existence of Unicode::MapUTF8 module done_testing(); __END__ I18N-Charset-1.419/t/rt33087.t0000644000175000017500000000057514006314523014633 0ustar martinmartin use blib; use Test::More; unless (eval "require Unicode::Map8") { plan skip_all => 'Unicode::Map8 is not installed'; } # unless plan tests => 3; use_ok('I18N::Charset', qw( iana_charset_name map8_charset_name )); is(iana_charset_name("koi8-r"), 'KOI8-R', 'iana literal koi8-r'); is(map8_charset_name("Koi 8 R"), 'koi8-r', 'map8 literal koi8-r'); done_testing(); __END__ I18N-Charset-1.419/t/mib.t0000644000175000017500000000405614006314427014351 0ustar martinmartin # mib.t - Tests for converting mib numbers back to charset names use Test::More; BEGIN { use_ok('I18N::Charset') }; #================================================ # TESTS FOR mib routine #================================================ #---- selection of examples which should all result in undef ----------- ok(!defined mib_charset_name(), q{no argument}); ok(!defined mib_charset_name(undef), q{undef argument}); ok(!defined mib_charset_name(""), q{empty argument}); ok(!defined mib_charset_name("junk"), q{illegal code}); ok(!defined mib_charset_name(9999999), q{illegal code}); ok(!defined mib_charset_name("None"), q{"None" is ignored}); my @aa; ok(!defined mib_charset_name(\@aa), q{illegal argument}); # The same things, in the opposite direction: ok(!defined charset_name_to_mib(), q{no argument}); ok(!defined charset_name_to_mib(undef), q{undef argument}); ok(!defined charset_name_to_mib(""), q{empty argument}); ok(!defined charset_name_to_mib("junk"), q{illegal code}); ok(!defined charset_name_to_mib(9999999), q{illegal code}); ok(!defined charset_name_to_mib("None"), q{"None" is ignored}); ok(!defined charset_name_to_mib(\@aa), q{illegal argument}); #---- some successful examples ----------------------------------------- ok(mib_charset_name("3") eq "US-ASCII", q{3 is US-ASCII}); ok(mib_charset_name("106") eq "UTF-8", q{106 is UTF-8}); ok(mib_to_charset_name("1015") eq "UTF-16", q{1015 is UTF-16}); ok(mib_to_charset_name("17") eq "Shift_JIS", q{17 is Shift_JIS}); # The same things, in the opposite direction: ok(charset_name_to_mib("ecma cyrillic") eq '77', q{ecma cyr is 77}); ok(charset_name_to_mib("UTF-8") == 106, q{UTF-8 is 106}); ok(charset_name_to_mib("UTF-16") == 1015, q{UTF-16 is 1015}); ok(charset_name_to_mib('s h i f t j i s') eq '17', q{s h i f t is 17}); # This is the FIRST entry in the IANA list: ok(charset_name_to_mib("ANSI_X3.4-1968") eq '3', q{first entry}); # This is the LAST entry in the IANA list: ok(charset_name_to_mib('CP50220') == 2260, q{last entry}); done_testing(); __END__ I18N-Charset-1.419/t/umap.t0000644000175000017500000000327014006314537014543 0ustar martinmartin# umap.t - tests for Unicode::Map functionality of I18N::Charset use I18N::Charset; use Test::More; use IO::Capture::Stderr; my $oICE = IO::Capture::Stderr->new; use strict; #================================================ # TESTS FOR umap routines #================================================ my @aa; #---- selection of examples which should all result in undef ----------- ok(!defined umap_charset_name(), 'no argument'); ok(!defined umap_charset_name(undef), 'undef argument'); ok(!defined umap_charset_name(""), 'empty argument'); ok(!defined umap_charset_name("junk"), 'junk argument'); ok(!defined umap_charset_name(999999), '999999 argument'); ok(!defined umap_charset_name(\@aa), 'arrayref argument'); $oICE->start; ok(!defined(I18N::Charset::add_umap_alias("alias1" => "junk")), '+alias1'); $oICE->stop; ok(!defined umap_charset_name("alias1"), '=alias1'); SKIP: { skip 'Unicode::Map is not installed', 8 unless eval "require Unicode::Map"; #---- some successful examples ----------------------------------------- ok(umap_charset_name("apple symbol") eq "APPLE-SYMBOL", 'dummy mib'); ok(umap_charset_name("Adobe Ding Bats") eq "ADOBE-DINGBATS", 'dummy mib'); ok(umap_charset_name("cs IBM-037") eq "CP037", 'same as iana'); ok(umap_charset_name("CP037") eq "CP037", 'identical'); #---- some aliasing examples ------------------------------------------- ok(I18N::Charset::add_umap_alias("alias2" => "IBM775") eq "CP775", '+alias2'); ok(umap_charset_name("alias2") eq "CP775", '=alias2'); ok(I18N::Charset::add_umap_alias("alias3" => "alias2") eq "CP775", '+alias3'); ok(umap_charset_name("alias3") eq "CP775", '=alias3'); } # end of SKIP block done_testing(); __END__ I18N-Charset-1.419/t/bug1.t0000644000175000017500000000073414006314310014426 0ustar martinmartin use ExtUtils::testlib; use Test::More; unless (eval "require Encode") { plan skip_all => 'Encode is not installed'; } # unless plan tests => 3; use_ok('I18N::Charset', 'enco_charset_name'); # There once was a bug in Charset.pm Where add_enco_alias() silently # failed if it was called before enco_charset_name() was ever called. ok(I18N::Charset::add_enco_alias('gb2312' => 'euc-cn')); is(enco_charset_name("gb2312"), 'euc-cn', 'test literal -- big5'); __END__ I18N-Charset-1.419/t/pod.t0000644000175000017500000000021714006314510014350 0ustar martinmartin use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); __END__ I18N-Charset-1.419/t/libi.t0000644000175000017500000000704514006314365014523 0ustar martinmartin# libi.t - tests for "preferred LIBI name" functionality of I18N::Charset # $Id: libi.t,v 1.14 2008-07-12 03:27:12 Martin Exp $ use blib; use Test::More; use IO::Capture::Stderr; my $oICE = IO::Capture::Stderr->new; use strict; BEGIN { use_ok('I18N::Charset') }; #================================================ # TESTS FOR libi routines #================================================ my @aa; #---- selection of examples which should all result in undef ----------- ok(!defined libi_charset_name(), 'no argument'); ok(!defined libi_charset_name(undef), 'undef argument'); ok(!defined libi_charset_name(""), 'empty argument'); ok(!defined libi_charset_name("junk"), 'junk argument'); ok(!defined libi_charset_name(999999), '999999 argument'); ok(!defined libi_charset_name(\@aa), 'arrayref argument'); $oICE->start; ok(!defined I18N::Charset::add_libi_alias("my-junk" => 'junk argument')); $oICE->stop; SKIP: { if (! eval "require App::Info::Lib::Iconv") { diag 'App::Info::Lib::Iconv is not installed'; skip 'App::Info::Lib::Iconv is not installed', 16; } # if my $oAILI = new App::Info::Lib::Iconv; SKIP: { if (! ref $oAILI) { diag('can not determine iconv version (not installed?)'); skip('can not determine iconv version (not installed?)', 16); } # if SKIP: { if (! $oAILI->installed) { diag('iconv is not installed'); skip('iconv is not installed', 16); } # if my $iLibiVersion = $oAILI->version || 0.0; diag "libiconv version is $iLibiVersion\n"; SKIP: { # Convert "n.m" into an actual floating point number so we can compare it: my $fLibiVersion = do { my @r = ($iLibiVersion =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; if ($fLibiVersion < 1.008) { diag 'iconv version is too old(?)'; skip 'iconv version is too old(?)', 16; } # if #---- some successful examples ----------------------------------------- is(libi_charset_name("x-x-sjis"), libi_charset_name("MS_KANJI"), 'x-x-sjis'); is(libi_charset_name("x-x-sjis"), "MS_KANJI", 'normal literal -- x-x-sjis'); is(libi_charset_name("G.B.K."), "CP936", 'normal -- G.B.K.'); is(libi_charset_name("CP936"), "CP936", 'identity -- CP936'); is(libi_charset_name("Johab"), "CP1361", 'normal -- Johab'); is(libi_charset_name("johab"), libi_charset_name("cp 1361"), 'equivalent -- johab'); #---- some aliasing examples ----------------------------------------- ok(I18N::Charset::add_libi_alias('my-chinese1' => 'CN-GB')); is(libi_charset_name("my-chinese1"), 'CN-GB', 'alias literal -- my-chinese1'); is(libi_charset_name("my-chinese1"), libi_charset_name('EUC-CN'), 'alias equal -- my-chinese1'); ok(I18N::Charset::add_libi_alias('my-chinese2' => 'EUC-CN')); is(libi_charset_name("my-chinese2"), 'CN-GB', 'alias literal -- my-chinese2'); is(libi_charset_name("my-chinese2"), libi_charset_name('G.B.2312'), 'alias equal -- my-chinese2'); ok(I18N::Charset::add_libi_alias('my-japanese' => 'x-x-sjis')); is(libi_charset_name("my-japanese"), 'MS_KANJI', 'alias literal -- my-japanese'); is(libi_charset_name("my-japanese"), libi_charset_name('Shift_JIS'), 'alias equal -- my-japanese'); pass; # I miscounted but I don't feel like going back and # changing all the 16 to 15 8-) } # end of SKIP block } # end of SKIP block } # end of SKIP block } # end of SKIP block pass; done_testing(); __END__ I18N-Charset-1.419/t/mime.t0000644000175000017500000000244414006314442014525 0ustar martinmartin # mime.t - tests for "preferred MIME name" functionality of I18N::Charset use Test::More; BEGIN { use_ok('I18N::Charset') }; #================================================ # TESTS FOR mime routines #================================================ my @aa; #---- selection of examples which should all result in undef ----------- ok(!defined mime_charset_name(), 'no argument'); ok(!defined mime_charset_name(undef), 'undef argument'); ok(!defined mime_charset_name(""), 'empty argument'); ok(!defined mime_charset_name("junk"), 'junk argument'); ok(!defined mime_charset_name(999999), '999999 argument'); ok(!defined mime_charset_name(\@aa), 'arrayref argument'); ok(!defined mime_charset_name("irv"), 'charset has no mime name'); #---- some successful examples ----------------------------------------- ok(mime_charset_name("us") eq "US-ASCII", 'us'); ok(mime_charset_name("ANSI_X3.4-1968") eq "US-ASCII", 'Alias is preferred, try Name'); ok(mime_charset_name("c s ascii") eq "US-ASCII", 'Alias is preferred, try another Alias'); ok(mime_charset_name("US-ASCII") eq "US-ASCII", 'Alias is preferred, try preferred Alias'); ok(mime_charset_name("ms_kanji_") eq "Shift_JIS", 'Name is preferred, try Alias'); ok(mime_charset_name("Big5") eq "Big5", 'Name is preferred, try Name'); done_testing(); __END__ I18N-Charset-1.419/t/iana.t0000644000175000017500000000473314006313346014513 0ustar martinmartin# $Revision: 1.11 $ # iana.t - tests for Locale::Country use ExtUtils::testlib; use Test::More; use IO::Capture::Stderr; my $oICE = IO::Capture::Stderr->new; use strict; BEGIN { use_ok('I18N::Charset') }; #================================================ # TESTS FOR iana routines #================================================ my @aa; #---- selection of examples which should all result in undef ----------- ok(!defined iana_charset_name(), 'no arg'); ok(!defined iana_charset_name(undef), 'undef argument'); ok(!defined iana_charset_name(""), 'empty argument'); ok(!defined iana_charset_name("junk"), 'junk argument'); ok(!defined iana_charset_name("None"), 'None argument'); ok(!defined iana_charset_name(\@aa), 'arrayref argument'); # illegal argument #---- some successful examples ----------------------------------------- ok(iana_charset_name("Windows-1-2-5-1") eq "windows-1251", 'windows-1-2-5-1'); ok(iana_charset_name("windows-1252") eq "windows-1252", 'windows-1252 eq'); ok(iana_charset_name("win-latin-1") eq "windows-1252", 'win-latin-1'); ok(iana_charset_name("windows-1252") ne "windows-1253", 'windows-1252 ne'); ok(iana_charset_name("windows-1253") eq "windows-1253", 'windows-1253'); ok(iana_charset_name("Shift_JIS") eq "Shift_JIS", 'Shift_JIS'); ok(iana_charset_name("sjis") eq "Shift_JIS", 'sjis'); ok(iana_charset_name("x-sjis") eq "Shift_JIS", 'x-sjis'); ok(iana_charset_name("x-x-sjis") eq "Shift_JIS", 'x-x-sjis'); ok(iana_charset_name("Unicode-2-0-utf-8") eq "UTF-8", 'Unicode-2-0-utf-8'); ok(iana_charset_name("ISO-8859-16") eq "ISO-8859-16", 'ISO-8859-16'); ok(iana_charset_name("latin 10") eq "ISO-8859-16", 'latin 10'); ok(iana_charset_name("csUTF7IMAP") eq "UTF-7-IMAP", 'UTF-7 IMAP'); #---- some aliasing examples ----------------------------------------- $oICE->start; ok(!defined(I18N::Charset::add_iana_alias("alias1" => "junk")), 'add alias1'); ok(!defined iana_charset_name("alias1"), 'alias1'); ok(!defined iana_charset_name("junk"), 'junk'); $oICE->stop; ok(I18N::Charset::add_iana_alias("alias2" => "Shift_JIS") eq "Shift_JIS", 'add alias2'); ok(iana_charset_name("alias2") eq "Shift_JIS", 'alias2'); ok(I18N::Charset::add_iana_alias("alias3" => "sjis") eq "Shift_JIS", ''); ok(iana_charset_name("alias3") eq "Shift_JIS", ''); ok(iana_charset_name("sjis") eq "Shift_JIS", ''); # Tests for coverage: my @asAll = I18N::Charset::all_iana_charset_names(); my $iAll = scalar(@asAll); diag("There are $iAll IANA charset names registered"); done_testing(); __END__ I18N-Charset-1.419/t/enco.t0000644000175000017500000000566514006314345014534 0ustar martinmartin# enco.t - tests for "preferred ENCO name" functionality of I18N::Charset use ExtUtils::testlib; use Test::More; use IO::Capture::Stderr; my $oICE = IO::Capture::Stderr->new; use strict; BEGIN { use_ok('I18N::Charset') }; #================================================ # TESTS FOR enco routines #================================================ my @aa; #---- selection of examples which should all result in undef ----------- ok(!defined enco_charset_name(), 'no argument'); ok(!defined enco_charset_name(undef), 'undef argument'); ok(!defined enco_charset_name(""), 'empty argument'); ok(!defined enco_charset_name("junk"), 'junk argument'); ok(!defined enco_charset_name(999999), '999999 argument'); ok(!defined enco_charset_name(\@aa), 'arrayref argument'); $oICE->start; ok(!defined I18N::Charset::add_enco_alias(undef => 'junk argument')); ok(!defined I18N::Charset::add_enco_alias('' => 'junk argument')); ok(!defined I18N::Charset::add_enco_alias("my-junk" => 'junk argument')); $oICE->stop; SKIP: { skip 'Encode is not installed', 18 unless eval "require Encode"; #---- some successful examples ----------------------------------------- is(enco_charset_name("x-x-sjis"), enco_charset_name("Shift JIS"), 'x-x-sjis'); is(enco_charset_name("x-ASCII"), "ascii", 'normal literal -- ASCII'); is(enco_charset_name("S-JIS"), "shiftjis", 'normal -- G.B.K.'); is(enco_charset_name("cp1251"), "cp1251", 'identity -- cp1251'); is(enco_charset_name("IBM1047"), "cp1047", 'builtin alias -- cp1047'); is(enco_charset_name("cp037"), "cp37", 'builtin alias -- cp37'); is(enco_charset_name("ebcdic-cp-us"), "cp37", 'builtin alias -- cp37'); is(enco_charset_name("windows-31-j"), "cp932", 'builtin alias -- cp932'); is(enco_charset_name("cs GB-2312"), "gb2312-raw", 'builtin alias -- gb2312-raw'); #---- some aliasing examples ----------------------------------------- ok(I18N::Charset::add_enco_alias('my-japanese1' => 'jis0201-raw')); is(enco_charset_name("my-japanese1"), 'jis0201-raw', 'alias literal -- my-japanese1'); is(enco_charset_name("my-japanese1"), enco_charset_name('jis-x-0201'), 'alias equal -- my-japanese1'); ok(I18N::Charset::add_enco_alias('my-japanese2' => 'jis0208-raw')); is(enco_charset_name("my-japanese2"), enco_charset_name('cs ISO-87 JIS_X0208'), 'alias equal -- my-japanese2'); ok(I18N::Charset::add_enco_alias('my-japanese3' => 'sjis'), 'set alias my-japanese3'); is(enco_charset_name("my-japanese3"), 'shiftjis', 'alias literal -- my-japanese3'); is(enco_charset_name("my-japanese3"), enco_charset_name('MS_KANJI'), 'alias equal -- my-japanese3'); ok(I18N::Charset::add_enco_alias('my-japanese4' => 'my-japanese1'), 'alias-to-alias'); is(enco_charset_name("my-japanese4"), enco_charset_name('my-japanese1'), 'alias equal -- my-japanese4'); is(enco_charset_name("my-japanese4"), 'jis0201-raw', 'alias equal -- my-japanese4'); } # end of SKIP block done_testing(); __END__ I18N-Charset-1.419/t/pod-coverage.t0000644000175000017500000000030414006314467016151 0ustar martinmartin use Test::More; my $VERSION = 1.002; eval "use Test::Pod::Coverage 1.00"; plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@; all_pod_coverage_ok(); __END__ I18N-Charset-1.419/t/map8.t0000644000175000017500000000431514006314406014442 0ustar martinmartin# map8.t - tests for Unicode::Map8 functionality of I18N::Charset use Test::More; use IO::Capture::Stderr; my $oICE = IO::Capture::Stderr->new; use strict; BEGIN { use_ok('I18N::Charset') }; #================================================ # TESTS FOR map8 routines #================================================ my @aa; #---- selection of examples which should all result in undef ----------- ok(!defined map8_charset_name(), ''); # no argument ok(!defined map8_charset_name(undef), ''); # undef argument ok(!defined map8_charset_name(""), ''); # empty argument ok(!defined map8_charset_name("junk"), ''); # illegal code ok(!defined map8_charset_name(\@aa), ''); # illegal argument $oICE->start; ok(!defined(I18N::Charset::add_map8_alias("alias1" => "junk")), ''); $oICE->stop; ok(!defined map8_charset_name("alias1"), ''); SKIP: { skip 'Unicode::Map8 is not installed', 16 unless eval "require Unicode::Map8"; #---- some successful examples ----------------------------------------- ok(map8_charset_name("ASMO_449") eq "ASMO_449", ''); ok(map8_charset_name("ISO_9036") eq "ASMO_449", ''); ok(map8_charset_name("arabic7") eq "ASMO_449", ''); ok(map8_charset_name("iso-ir-89") eq "ASMO_449", ''); ok(map8_charset_name("ISO-IR-89") eq "ASMO_449", ''); ok(map8_charset_name("ISO - ir _ 89") eq "ASMO_449", ''); #---- an iana example that ONLY works with Unicode::Map8 installed ----- ok(iana_charset_name("cp1251") eq "windows-1251", ''); #---- some aliasing examples ------------------------------------------- ok(I18N::Charset::add_map8_alias("alias2" => "ES2") eq "ES2", ''); ok(map8_charset_name("alias2") eq "ES2", ''); ok(I18N::Charset::add_map8_alias("alias3" => "iso-ir-85") eq "ES2", ''); ok(map8_charset_name("alias3") eq "ES2", ''); ok(map8_charset_name("Ebcdic cp FI") eq "IBM278", ''); ok(map8_charset_name("IBM278") eq "IBM278", ''); ok(I18N::Charset::add_map8_alias("my278" => "IBM278") eq "IBM278", ''); ok(map8_charset_name("My 278") eq "IBM278", ''); ok(map8_charset_name("cp278") eq "IBM278", ''); } # end of SKIP block done_testing(); __END__ I18N-Charset-1.419/Changes0000644000175000017500000001342514006311617014443 0ustar martinmartin2015-02-02 Kingpin * lib/I18N/Charset.pm: removed 'use blib' (no idea why it was in here) 2011-10-31 Kingpin * lib/I18N/Charset.pm (_init_data): new IANA charset list 2010-11-06 Kingpin * lib/I18N/Charset.pm (_init_data): new IANA charset list (one new charset defined) 2010-09-17 Kingpin * lib/I18N/Charset.pm (_init_data): new IANA charset list (one new charset defined) 2008-07-05 Kingpin * lib/I18N/Charset.pm: overhauled the U::Map8 initialization (_init_data_extra): added aliases listed in RT#18802 2008-02-15 * lib/I18N/Charset.pm: initialize also from Unicode::Map8 .bin files 2007-05-18 * lib/I18N/Charset.pm (mib_charset_name): added pod 2007-05-17 * lib/I18N/Charset.pm (_init_data): new char-sets document from IANA (maybe no net change, just re-ordered?) (mib_charset_name): added pod 2006-12-08 * lib/I18N/Charset.pm (_init_data): new IANA charset list (three new charsets defined) 2006-05-02 * lib/I18N/Charset.pm (_init_data): fix typo in IANA website 2005-11-12 * t/*.t: stop using deprecated IO::Capture::ErrorMessages 2005-08-31 * lib/I18N/Charset.pm (_strip): do not pollute IANA charset list with Unicode::Map charset names 2005-01-29 Kingpin * lib/I18N/Charset.pm (_init_data): new IANA charset list (only comments changed) 2004-10-25 Kingpin * lib/I18N/Charset.pm (_init_data_extra): added aliases for Encode; fixed some typos in debug messages 2004-02-10 Kingpin * lib/I18N/Charset.pm (_init_data): undo bug in IANA's document (_init_data_extra): undo our workaround 2004-02-07 Kingpin * t/bug1.t: skip if Encode is not installed * lib/I18N/Charset.pm: new IANA document (one alias added) 2004-01-30 Kingpin * lib/I18N/Charset.pm (_init_data): new IANA document (typos fixed) 2004-01-24 Kingpin * lib/I18N/Charset.pm (_init_data): new IANA document (5 new charsets) 2004-01-15 Kingpin * lib/I18N/Charset.pm (enco_charset_name): BUGFIX: encoding names were not initialized sometimes 2003-03-28 Kingpin * t/enco.t: new file * lib/I18N/Charset.pm (enco_charset_name): new methods for Encode encoding names 2002-10-11 Kingpin * t/libi.t: use App::Info::Lib::Iconv instead of File::Which * lib/I18N/Charset.pm: check iconv version before running it (libi_charset_name): load iconv tables not at startup, but only when needed 2002-10-10 Kingpin * lib/I18N/Charset.pm: make sure iconv exists before executing it * t/libi.t: new test file * lib/I18N/Charset.pm (libi_charset_name): added support for iconv names 2002-10-07 Kingpin * t/utf8.t: typo, and require Unicode::MapUTF8 version 1.09 2002-10-02 Kingpin * lib/I18N/Charset.pm (_init_data): new charset list from IANA * t/iana.t: two new tests for new data 2002-09-05 Kingpin * lib/I18N/Charset.pm: new function mime_charset_name() 2002-08-09 Kingpin * lib/I18N/Charset.pm (_init_data): use IO::String instead of __DATA__ mechanism 2002-06-17 Kingpin * lib/I18N/Charset.pm: new charset list from IANA 2002-05-29 Kingpin * lib/I18N/Charset.pm: new charset list from IANA 2002-05-01 Kingpin * lib/I18N/Charset.pm: added support for Unicode::MapUTF8 * updated several of the tests 2002-04-15 Kingpin * lib/I18N/Charset.pm: new IANA charset list 2002-02-07 Kingpin * lib/I18N/Charset.pm (short_to_mib): short-circuit on positive answer (body): BUGFIX for processing Unicode::Map's REGISTRY 2002-02-05 Kingpin * t/utf8.t: new file * t/umap.t: now uses Test::More * t/map8.t: now uses Test::More * t/mib.t: new file * lib/I18N/Charset.pm (mib_to_charset_name): renamed function 2002-01-10 Kingpin * lib/I18N/Charset.pm (charset_name_to_mib): new function (thanks to François) 2001-11-30 Kingpin * lib/I18N/Charset.pm (strip): localize $/ 2001-09-04 Kingpin * lib/I18N/Charset.pm (strip): handle whitespace in blank lines of Unicode::Map/REGISTRY 2001-08-24 Kingpin * lib/I18N/Charset.pm: new IANA charset list 2001-06-05 Kingpin * 1.09 released 2001-06-04 Kingpin * lib/I18N/Charset.pm: new IANA charset list in __DATA__; update code & tests to match 2001-04-19 Kingpin * lib/I18N/Charset.pm: removed some incorrect aliases (thanks to Liam Quinn) 2001-03-08 Kingpin * 1.07 released 2001-03-07 Kingpin * README: mention maputf8 tests are skipped * lib/I18N/Charset.pm (try_list): be more forgiving during ALL lookups 2001-03-06 Kingpin * 1.06 released 2001-03-05 Kingpin * lib/I18N/Charset.pm: added support for Unicode::Map 2001-01-08 Kingpin * 1.05 released (fixed pod) 1999-07-09 Kingpin * 1.03 released (no code changes, just cleaned up the distribution) 1998-07-29 Kingpin * 1.02 tests don't complain if Unicode::Map8 is not installed; a few tiny documentation changes 1998-07-16 Kingpin * 1.01 first released version I18N-Charset-1.419/META.yml0000644000175000017500000000153414006312576014424 0ustar martinmartin--- abstract: 'IANA Character Set Registry names and Unicode::MapUTF8 (et al.) conversion scheme names' author: - "Martin 'Kingpin' Thurn, C, L." build_requires: ExtUtils::MakeMaker: 6.36 IO::Capture::Stderr: 0 Test::More: 0 configure_requires: ExtUtils::MakeMaker: 6.36 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.19' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 module_name: I18N::Charset name: I18N-Charset no_index: directory: - inc - t recommends: App::Info::Lib::Iconv: 0 Encode: 0 Jcode: 0 Test::Pod: 0 Test::Pod::Coverage: 0 Unicode::Map: 0 Unicode::Map8: 0 Unicode::MapUTF8: 0 requires: perl: '5.005' resources: license: http://dev.perl.org/licenses/ version: 1.417 I18N-Charset-1.419/lib/0000755000175000017500000000000014006315244013711 5ustar martinmartinI18N-Charset-1.419/lib/I18N/0000755000175000017500000000000014006315244014370 5ustar martinmartinI18N-Charset-1.419/lib/I18N/Charset.pm0000644000175000017500000044727514006315233016340 0ustar martinmartin # $rcs = ' $Id: Charset.pm,v 1.414 2015-02-02 19:49:14 Martin Exp $ ' ; package I18N::Charset; use strict; use warnings; require 5.005; use base 'Exporter'; use Carp; =head1 NAME I18N::Charset - IANA Character Set Registry names and Unicode::MapUTF8 (et al.) conversion scheme names =head1 SYNOPSIS use I18N::Charset; $sCharset = iana_charset_name('WinCyrillic'); # $sCharset is now 'windows-1251' $sCharset = umap_charset_name('Adobe DingBats'); # $sCharset is now 'ADOBE-DINGBATS' which can be passed to Unicode::Map->new() $sCharset = map8_charset_name('windows-1251'); # $sCharset is now 'cp1251' which can be passed to Unicode::Map8->new() $sCharset = umu8_charset_name('x-sjis'); # $sCharset is now 'sjis' which can be passed to Unicode::MapUTF8->new() $sCharset = libi_charset_name('x-sjis'); # $sCharset is now 'MS_KANJI' which can be passed to `iconv -f $sCharset ...` $sCharset = enco_charset_name('Shift-JIS'); # $sCharset is now 'shiftjis' which can be passed to Encode::from_to() I18N::Charset::add_iana_alias('my-japanese' => 'iso-2022-jp'); I18N::Charset::add_map8_alias('my-arabic' => 'arabic7'); I18N::Charset::add_umap_alias('my-hebrew' => 'ISO-8859-8'); I18N::Charset::add_libi_alias('my-sjis' => 'x-sjis'); I18N::Charset::add_enco_alias('my-japanese' => 'shiftjis'); =head1 DESCRIPTION The C module provides access to the IANA Character Set Registry names for identifying character encoding schemes. It also provides a mapping to the character set names used by the Unicode::Map and Unicode::Map8 modules. So, for example, if you get an HTML document with a META CHARSET="..." tag, you can fairly quickly determine what Unicode::MapXXX module can be used to convert it to Unicode. If you don't have the module Unicode::Map installed, the umap_ functions will always return undef. If you don't have the module Unicode::Map8 installed, the map8_ functions will always return undef. If you don't have the module Unicode::MapUTF8 installed, the umu8_ functions will always return undef. If you don't have the iconv library installed, the libi_ functions will always return undef. If you don't have the Encode module installed, the enco_ functions will always return undef. =cut #----------------------------------------------------------------------- # Public Global Variables #----------------------------------------------------------------------- our $VERSION = 1.419; our @EXPORT = qw( iana_charset_name map8_charset_name umap_charset_name umu8_charset_name mib_charset_name mime_charset_name libi_charset_name enco_charset_name mib_to_charset_name charset_name_to_mib ); our @EXPORT_OK = qw( add_iana_alias add_map8_alias add_umap_alias add_libi_alias add_enco_alias ); #----------------------------------------------------------------------- # Private Global Variables #----------------------------------------------------------------------- # %hsMIBofShortname is a hash of stripped names to mib. my %hsMIBofShortname; # %hsLongnameOfMIB is a hash of mib to long name. my %hsLongnameOfMIB; # %hsMIBofLongname is a hash of long name to mib. my %hsMIBofLongname; # %hsMIMEofMIB is a hash of mib to preferred MIME names. my %hsMIMEofMIB; # %MIBtoMAP8 is a hash of mib to Unicode::Map8 names. (Only valid for # those U::Map8 names that we can find in the IANA registry) my %MIBtoMAP8; # %MIBtoUMAP is a hash of mib to Unicode::Map names. If a U::Map # encoding does not have an official IANA entry, we create a dummy mib # for it. my %MIBtoUMAP; # %MIBtoUMU8 is a hash of mib to Unicode::MapUTF8 names. If a # U::MapUTF8 encoding does not have an official IANA entry, we create # a dummy mib for it. my %MIBtoUMU8; # %MIBtoLIBI is a hash of mib to libiconv names. (Only valid for # those libiconv names that we can find in the IANA registry) my %MIBtoLIBI; # %MIBtoENCO is a hash of mib to Encode names. (Only valid for # those Encode names that we can find in the IANA registry) my %MIBtoENCO; use constant DEBUG => 0; use constant DEBUG_ENCO => 0; use constant DEBUG_LIBI => 0; =head1 CONVERSION ROUTINES There are four main conversion routines: C, C, C, and C. =over 4 =item iana_charset_name() This function takes a string containing the name of a character set and returns a string which contains the official IANA name of the character set identified. If no valid character set name can be identified, then C will be returned. The case and punctuation within the string are not important. $sCharset = iana_charset_name('WinCyrillic'); =cut my $sDummy = 'dummymib'; my $sFakeMIB = $sDummy .'001'; sub _is_dummy { my $s = shift; return ($s =~ m!\A$sDummy!); } # _is_dummy sub iana_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; # $iDebug = ($code =~ m!sjis!); # print STDERR " + iana_charset_name($code)..." if $iDebug; my $mib = _short_to_mib($code); return undef unless defined $mib; # print STDERR " + mib is ($mib)..." if $iDebug; # Make sure this is really a IANA mib: return undef if _is_dummy($mib); # print STDERR " + is really iana..." if $iDebug; return $hsLongnameOfMIB{$mib}; } # iana_charset_name sub _try_list { my $code = shift; my @asTry = ($code, _strip($code)); push @asTry, _strip($code) if $code =~ s!\A(x-)+!!; # try without leading x- return @asTry; } # _try_list sub _short_to_mib { my $code = shift; local $^W = 0; # print STDERR " + _short_to_mib($code)..." if DEBUG; my $answer = undef; TRY_SHORT: foreach my $sTry (_try_list($code)) { my $iMIB = $hsMIBofShortname{$sTry} || 'undef'; # print STDERR "try($sTry)...$iMIB..." if DEBUG; if ($iMIB ne 'undef') { $answer = $iMIB; last TRY_SHORT; } # if } # foreach # print STDERR "answer is $answer\n" if DEBUG; return $answer; } # _short_to_mib sub _short_to_long { local $^W = 0; my $s = shift; # print STDERR " + _short_to_long($s)..." if DEBUG; return $hsLongnameOfMIB{_short_to_mib($s)}; } # _short_to_long =item mime_charset_name() This function takes a string containing the name of a character set and returns a string which contains the preferred MIME name of the character set identified. If no valid character set name can be identified, then C will be returned. The case and punctuation within the string are not important. $sCharset = mime_charset_name('Extended_UNIX_Code_Packed_Format_for_Japanese'); =cut sub mime_charset_name { # This function contributed by Masafumi "Max" Nakane. Thank you! my $code = shift; return undef unless defined $code; return undef unless $code ne ''; # print STDERR " + mime_charset_name($code)..." if DEBUG; my $mib = _short_to_mib($code); return undef unless defined $mib; # print STDERR " + mib is ($mib)..." if DEBUG; # Make sure this is really an IANA mib: return undef if _is_dummy($mib); # print STDERR " + is really iana..." if DEBUG; return $hsMIMEofMIB{$mib}; } # mime_charset_name =item enco_charset_name() This function takes a string containing the name of a character set and returns a string which contains a name of the character set suitable to be passed to the Encode module. If no valid character set name can be identified, or if Encode is not installed, then C will be returned. The case and punctuation within the string are not important. $sCharset = enco_charset_name('Extended_UNIX_Code_Packed_Format_for_Japanese'); =cut my $iEncoLoaded = 0; sub _maybe_load_enco # PRIVATE { return if $iEncoLoaded; # Get a list of aliases from Encode: if (eval q{require Encode}) { my @as; @as = Encode->encodings(':all'); # push @as, Encode->encodings('EBCDIC'); my $iFake = 0; my $iReal = 0; ENCODING: foreach my $s (@as) { # First, see if this already has an IANA mapping: my $mib; my $sIana = iana_charset_name($s); if (!defined $sIana) { # Create a dummy mib: $mib = $sFakeMIB++; $iFake++; } # if else { $mib = charset_name_to_mib($sIana); $iReal++; } # At this point we have a mib for this Encode entry. $MIBtoENCO{$mib} = $s; DEBUG_ENCO && print STDERR " + mib for enco ==$s== is $mib\n"; $hsMIBofShortname{_strip($s)} = $mib; DEBUG_ENCO && print STDERR " + assign enco =$s==>$mib\n" if _is_dummy($mib); } # foreach ENCODING if (DEBUG_ENCO) { print STDERR " + Summary of Encode encodings:\n"; printf STDERR (" + %d encodings found.\n", scalar(@as)); print STDERR " + $iFake fake mibs created.\n"; print STDERR " + $iReal real mibs re-used.\n"; } # if $iEncoLoaded = 1; add_enco_alias('Windows-31J', 'cp932'); } # if else { print STDERR " --- Encode is not installed\n"; } } # _maybe_load_enco sub _mib_to_enco # PRIVATE { _maybe_load_enco(); return $MIBtoENCO{shift()}; } # _mib_to_enco sub enco_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; _maybe_load_enco(); my $iDebug = 0; # ($code =~ m!johab!i); print STDERR " + enco_charset_name($code)..." if ($iDebug || DEBUG_ENCO); my $mib = _short_to_mib($code); return undef unless defined $mib; print STDERR " + mib is ($mib)..." if ($iDebug || DEBUG_ENCO); my $ret = _mib_to_enco($mib); print STDERR " + enco is ($ret)..." if ($iDebug || DEBUG_ENCO); return $ret; } # enco_charset_name =item libi_charset_name() This function takes a string containing the name of a character set and returns a string which contains a name of the character set suitable to be passed to iconv. If no valid character set name can be identified, then C will be returned. The case and punctuation within the string are not important. $sCharset = libi_charset_name('Extended_UNIX_Code_Packed_Format_for_Korean'); =cut my $iLibiLoaded = 0; sub _maybe_load_libi # PRIVATE { return if $iLibiLoaded; # Get a list of aliases from iconv: return unless eval 'require App::Info::Lib::Iconv'; my $oAILI = new App::Info::Lib::Iconv; if (ref $oAILI) { my $iLibiVersion = $oAILI->version; DEBUG_LIBI && warn " DDD libiconv version is $iLibiVersion\n"; if ($oAILI->installed && (1.08 <= $iLibiVersion)) { my $sCmd = $oAILI->bin_dir . '/iconv -l'; DEBUG_LIBI && warn " DDD iconv cmdline is $sCmd\n"; my @asIconv = split(/\n/, `$sCmd`); ICONV_LINE: foreach my $sLine (@asIconv) { my @asWord = split(/\s+/, $sLine); # First, go through and find one of these that has an IANA mapping: my $mib; my $sIana = undef; FIND_IANA: foreach my $sWord (@asWord) { last FIND_IANA if ($sIana = iana_charset_name($sWord)); } # foreach FIND_IANA if (!defined $sIana) { # Create a dummy mib: $mib = $sFakeMIB++; } # if else { $mib = charset_name_to_mib($sIana); } # At this point we have a mib for this iconv entry. Assign them all: ADD_LIBI: foreach my $sWord (reverse @asWord) { $MIBtoLIBI{$mib} = $sWord; DEBUG_LIBI && warn " + mib for libi ==$sWord== is $mib\n"; $hsMIBofShortname{_strip($sWord)} = $mib; } # foreach ADD_LIBI } # foreach ICONV_LINE } # if } # if $iLibiLoaded = 1; } # _maybe_load_libi sub _mib_to_libi # PRIVATE { _maybe_load_libi(); return $MIBtoLIBI{shift()}; } # _mib_to_libi sub libi_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; # my $iDebug = 1; # ($code =~ m!johab!i); # print STDERR " + libi_charset_name($code)..." if $iDebug; my $mib = _short_to_mib($code); return undef unless defined $mib; # print STDERR " + mib is ($mib)..." if $iDebug; my $ret = _mib_to_libi($mib); # print STDERR " + libi is ($ret)..." if $iDebug; return $ret; } # libi_charset_name =item mib_to_charset_name This function takes a string containing the MIBenum of a character set and returns a string which contains a name for the character set. If the given MIBenum does not correspond to any character set, then C will be returned. $sCharset = mib_to_charset_name('3'); =cut sub mib_to_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; local $^W = 0; return $hsLongnameOfMIB{$code}; } # mib_to_charset_name =item mib_charset_name This is a synonum for mib_to_charset_name =cut sub mib_charset_name { mib_to_charset_name(@_); } # mib_charset_name =item charset_name_to_mib This function takes a string containing the name of a character set in almost any format and returns a MIBenum for the character set. For IANA-registered character sets, this is the IANA-registered MIB. For non-IANA character sets, this is an unambiguous unique string whose only use is to pass to other functions in this module. If no valid character set name can be identified, then C will be returned. $iMIB = charset_name_to_mib('US-ASCII'); =cut sub charset_name_to_mib { my $s = shift; return undef unless defined($s); return $hsMIBofLongname{$s} || $hsMIBofLongname{ iana_charset_name($s) || umap_charset_name($s) || map8_charset_name($s) || umu8_charset_name($s) || '' }; } # charset_name_to_mib =item map8_charset_name() This function takes a string containing the name of a character set (in almost any format) and returns a string which contains a name for the character set that can be passed to Unicode::Map8::new(). Note: the returned string will be capitalized just like the name of the .bin file in the Unicode::Map8::MAPS_DIR directory. If no valid character set name can be identified, then C will be returned. The case and punctuation within the argument string are not important. $sCharset = map8_charset_name('windows-1251'); =cut sub map8_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; # $iDebug = 0 && ($code =~ m!037!); # print STDERR " + map8_charset_name($code)..." if $iDebug; $code = _strip($code); # print STDERR "$code..." if $iDebug; my $iMIB = _short_to_mib($code) || 'undef'; # print STDERR "$iMIB..." if $iDebug; if ($iMIB ne 'undef') { # print STDERR "$MIBtoMAP8{$iMIB}\n" if $iDebug; return $MIBtoMAP8{$iMIB}; } # if # print STDERR "undef\n" if $iDebug; return undef; } # map8_charset_name =item umap_charset_name() This function takes a string containing the name of a character set (in almost any format) and returns a string which contains a name for the character set that can be passed to Unicode::Map::new(). If no valid character set name can be identified, then C will be returned. The case and punctuation within the argument string are not important. $sCharset = umap_charset_name('hebrew'); =cut sub umap_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; # $iDebug = ($code =~ m!apple!i); # print STDERR "\n + MIBtoUMAP{dummymib029} == $MIBtoUMAP{$sDummy .'029'}\n\n" if $iDebug; # print STDERR " + umap_charset_name($code)..." if $iDebug; my $iMIB = _short_to_mib(_strip($code)) || 'undef'; # print STDERR "$iMIB..." if $iDebug; if ($iMIB ne 'undef') { # print STDERR "$MIBtoUMAP{$iMIB}\n" if $iDebug; return $MIBtoUMAP{$iMIB}; } # if # print STDERR "undef\n" if $iDebug; return undef; } # umap_charset_name our @asMap8Debug; =item umu8_charset_name() This function takes a string containing the name of a character set (in almost any format) and returns a string which contains a name for the character set that can be passed to Unicode::MapUTF8::new(). If no valid character set name can be identified, then C will be returned. The case and punctuation within the argument string are not important. $sCharset = umu8_charset_name('windows-1251'); =cut sub umu8_charset_name { my $code = shift; return undef unless defined $code; return undef unless $code ne ''; # $iDebug = ($code =~ m!u!); # print STDERR " + umu8_charset_name($code)..." if $iDebug; my $iMIB = _short_to_mib($code) || 'undef'; # print STDERR "$iMIB..." if $iDebug; if ($iMIB ne 'undef') { # print STDERR "$MIBtoUMU8{$iMIB}\n" if $iDebug; return $MIBtoUMU8{$iMIB}; } # if # print STDERR "undef\n" if $iDebug; return undef; } # umu8_charset_name =back =head1 QUERY ROUTINES There is one function which can be used to obtain a list of all IANA-registered character set names. =over 4 =item C Returns a list of all registered IANA character set names. The names are not in any particular order. =back =cut sub all_iana_charset_names { return values %hsLongnameOfMIB; } # all_iana_charset_names #----------------------------------------------------------------------- =head1 CHARACTER SET NAME ALIASING This module supports several semi-private routines for specifying character set name aliases. =over 4 =item add_iana_alias() This function takes two strings: a new alias, and a target IANA Character Set Name (or another alias). It defines the new alias to refer to that character set name (or to the character set name to which the second alias refers). Returns the target character set name of the successfully installed alias. Returns 'undef' if the target character set name is not registered. Returns 'undef' if the target character set name of the second alias is not registered. I18N::Charset::add_iana_alias('my-alias1' => 'Shift_JIS'); With this code, "my-alias1" becomes an alias for the existing IANA character set name 'Shift_JIS'. I18N::Charset::add_iana_alias('my-alias2' => 'sjis'); With this code, "my-alias2" becomes an alias for the IANA character set name referred to by the existing alias 'sjis' (which happens to be 'Shift_JIS'). =cut sub add_iana_alias { my ($sAlias, $sReal) = @_; # print STDERR " + add_iana_alias($sAlias, $sReal)\n"; my $sName = iana_charset_name($sReal); if (not defined($sName)) { carp qq{attempt to alias "$sAlias" to unknown IANA charset "$sReal"}; return undef; } # if my $mib = _short_to_mib(_strip($sName)); # print STDERR " --> $sName --> $mib\n"; $hsMIBofShortname{_strip($sAlias)} = $mib; return $sName; } # add_iana_alias #----------------------------------------------------------------------- =item add_map8_alias() This function takes two strings: a new alias, and a target Unicode::Map8 Character Set Name (or an existing alias to a Map8 name). It defines the new alias to refer to that mapping name (or to the mapping name to which the second alias refers). If the first argument is a registered IANA character set name, then all aliases of that IANA character set name will end up pointing to the target Map8 mapping name. Returns the target mapping name of the successfully installed alias. Returns 'undef' if the target mapping name is not registered. Returns 'undef' if the target mapping name of the second alias is not registered. I18N::Charset::add_map8_alias('normal' => 'ANSI_X3.4-1968'); With the above statement, "normal" becomes an alias for the existing Unicode::Map8 mapping name 'ANSI_X3.4-1968'. I18N::Charset::add_map8_alias('normal' => 'US-ASCII'); With the above statement, "normal" becomes an alias for the existing Unicode::Map mapping name 'ANSI_X3.4-1968' (which is what "US-ASCII" is an alias for). I18N::Charset::add_map8_alias('IBM297' => 'EBCDIC-CA-FR'); With the above statement, "IBM297" becomes an alias for the existing Unicode::Map mapping name 'EBCDIC-CA-FR'. As a side effect, all the aliases for 'IBM297' (i.e. 'cp297' and 'ebcdic-cp-fr') also become aliases for 'EBCDIC-CA-FR'. =cut sub add_map8_alias { my ($sAlias, $sReal) = @_; my $sName = map8_charset_name($sReal); my $sShort = _strip($sAlias); my $sShortName = _strip($sName); if (not defined($sName)) { carp qq{attempt to alias "$sAlias" to unknown Map8 charset "$sReal"}; return undef; } # if if (exists $hsMIBofShortname{$sShortName}) { $hsMIBofShortname{$sShort} = $hsMIBofShortname{$sShortName}; } # if return $sName; } # add_map8_alias #----------------------------------------------------------------------- =item add_umap_alias() This function works identically to add_map8_alias() above, but operates on Unicode::Map encoding tables. =cut sub add_umap_alias { my ($sAlias, $sReal) = @_; my $sName = umap_charset_name($sReal); my $sShort = _strip($sAlias); my $sShortName = _strip($sName); if (not defined($sName)) { carp qq{attempt to alias "$sAlias" to unknown U::Map charset "$sReal"}; return undef; } # if if (exists $hsMIBofShortname{$sShortName}) { $hsMIBofShortname{$sShort} = $hsMIBofShortname{$sShortName}; } # if return $sName; } # add_umap_alias #----------------------------------------------------------------------- =item add_libi_alias() This function takes two strings: a new alias, and a target iconv Character Set Name (or existing iconv alias). It defines the new alias to refer to that character set name (or to the character set name to which the existing alias refers). Returns the target conversion scheme name of the successfully installed alias. Returns 'undef' if there is no such target conversion scheme or alias. Examples: I18N::Charset::add_libi_alias('my-chinese1' => 'CN-GB'); With this code, "my-chinese1" becomes an alias for the existing iconv conversion scheme 'CN-GB'. I18N::Charset::add_libi_alias('my-chinese2' => 'EUC-CN'); With this code, "my-chinese2" becomes an alias for the iconv conversion scheme referred to by the existing alias 'EUC-CN' (which happens to be 'CN-GB'). =cut sub add_libi_alias { my ($sAlias, $sReal) = @_; # print STDERR " + add_libi_alias($sAlias,$sReal)..."; my $sName = libi_charset_name($sReal); if (not defined($sName)) { carp qq{attempt to alias "$sAlias" to unknown iconv charset "$sReal"}; return undef; } # if my $mib = _short_to_mib(_strip($sName)); # print STDERR "sName=$sName...mib=$mib\n"; $hsMIBofShortname{_strip($sAlias)} = $mib; return $sName; } # add_libi_alias #----------------------------------------------------------------------- =item add_enco_alias() This function takes two strings: a new alias, and a target Encode encoding Name (or existing Encode alias). It defines the new alias referring to that encoding name (or to the encoding to which the existing alias refers). Returns the target encoding name of the successfully installed alias. Returns 'undef' if there is no such encoding or alias. Examples: I18N::Charset::add_enco_alias('my-japanese1' => 'jis0201-raw'); With this code, "my-japanese1" becomes an alias for the existing encoding 'jis0201-raw'. I18N::Charset::add_enco_alias('my-japanese2' => 'my-japanese1'); With this code, "my-japanese2" becomes an alias for the encoding referred to by the existing alias 'my-japanese1' (which happens to be 'jis0201-raw' after the previous call). =cut sub add_enco_alias { my ($sAlias, $sReal) = @_; my $iDebug = 0; print STDERR " + add_enco_alias($sAlias,$sReal)..." if ($iDebug || DEBUG_ENCO); my $sName = enco_charset_name($sReal); if (not defined($sName)) { carp qq{attempt to alias "$sAlias" to unknown Encode charset "$sReal"}; return undef; } # if my $mib = _short_to_mib(_strip($sName)); print STDERR "sName=$sName...mib=$mib\n" if ($iDebug || DEBUG_ENCO); $hsMIBofShortname{_strip($sAlias)} = $mib; return $sName; } # add_enco_alias #----------------------------------------------------------------------- =back =head1 KNOWN BUGS AND LIMITATIONS =over 4 =item * There could probably be many more aliases added (for convenience) to all the IANA names. If you have some specific recommendations, please email the author! =item * The only character set names which have a corresponding mapping in the Unicode::Map8 module are the character sets that Unicode::Map8 can convert. Similarly, the only character set names which have a corresponding mapping in the Unicode::Map module are the character sets that Unicode::Map can convert. =item * In the current implementation, all tables are read in and initialized when the module is loaded, and then held in memory until the program exits. A "lazy" implementation (or a less-portable tied hash) might lead to a shorter startup time. Suggestions, patches, comments are always welcome! =back =head1 SEE ALSO =over 4 =item Unicode::Map Convert strings from various multi-byte character encodings to and from Unicode. =item Unicode::Map8 Convert strings from various 8-bit character encodings to and from Unicode. =item Jcode Convert strings among various Japanese character encodings and Unicode. =item Unicode::MapUTF8 A wrapper around all three of these character set conversion distributions. =back =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. =head1 LICENSE This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut #----------------------------------------------------------------------- sub _strip { my $s = lc(shift); $s =~ tr/[0-9a-zA-Z]//dc; return $s; } # _strip # initialization code - stuff the DATA into some data structure # The only reason this is a while loop is so that I can bail out # (e.g. for debugging) without using goto ;-) INITIALIZATION: { my ($sName, $iMIB, $sAlias, $mimename); my $iDebug = 0; # I used to use the __DATA__ mechanism to initialize the data, but # that is not compatible with perlapp. NOTE that storing the IANA # charset data as a file separate from this module code will not # work with perlapp either! my $s = _init_data(); my $iRecord = 0; RECORD: while ($s =~ m//gs) { my $sRecord = $1; $iRecord++; if ($sRecord !~ m/(.+?)<\/name>/) { warn " WWW found record with no name.\n"; next RECORD; } # if my $sName = $1; if ($sRecord !~ m/(\d+)<\/value>/) { warn " WWW found record '$sName' with no value.\n"; next RECORD; } # if my $iMIB = $1; if ($sRecord =~ m/(.+?)<\/preferred_alias>/) { $hsMIMEofMIB{$iMIB} = $1; $hsMIBofShortname{_strip($1)} = $iMIB; } else { # warn " WWW found record '$sName' with no preferred alias.\n"; } # if my $sMime = $1; $hsLongnameOfMIB{$iMIB} = $sName; $hsMIBofLongname{$sName} = $iMIB; # warn " DDD '$sName' ==> $iMIB\n"; $hsMIBofShortname{_strip($sName)} = $iMIB; ALIAS: while ($sRecord =~ m/(.+?)<\/alias>/g) { my $sAlias = $1; $hsMIBofShortname{_strip($sAlias)} = $iMIB; } # while ALIAS } # while RECORD # Now that we have all the standard definitions, process the special # === directives: my @asEqualLines = split(/\n/, _init_data_extra()); chomp @asEqualLines; EQUAL_LINE: foreach my $sLine (@asEqualLines) { next if ($sLine =~ m!\A#!); # print STDERR " + equal-sign line $sLine...\n"; my @as = split(/\ ===\ /, $sLine); my $sName = shift @as || q{}; next unless $sName ne ''; my $iMIB = $hsMIBofShortname{_strip($sName)} || 0; if (! $iMIB) { print STDERR " EEE can not find IANA entry for equal-sign directive $sName\n"; next EQUAL_LINE; } # unless EQUAL_ITEM: foreach my $s (@as) { my $sStrip = _strip($s); # print STDERR " + $sStrip --> $iMIB\n"; $hsMIBofShortname{$sStrip} = $iMIB; } # foreach EQUAL_ITEM } # foreach EQUAL_LINE # last; # for debugging if (eval "require Unicode::Map8") { # $iDebug = 1; my $sDir = $Unicode::Map8::MAPS_DIR; my $sAliasesFname = "$sDir/aliases"; # Ah, how to get all the Unicode::Map8 supported charsets... It # sure ain't easy! The aliases file in the MAPS_DIR has a nice # set of aliases, but since some charsets have no aliases, they're # not listed in the aliases file! Ergo, we have to read the # aliases file *and* all the file names in the MAPS_DIR! push @asMap8Debug, " DDD found Unicode::Map8 installed, will build map8 tables based on $sAliasesFname and files in that directory...\n"; # First, read all the files in the MAPS_DIR folder and register in our local data structures: if (opendir(DIR, $sDir)) { my @asFname = grep(!/^\.\.?$/, readdir(DIR)); foreach my $sLong (@asFname) { next unless -f "$Unicode::Map8::MAPS_DIR/$sLong"; $sLong =~ s/\.(?:bin|txt)$//; # Try to find the official IANA name for this encoding: push @asMap8Debug, " DDD looking for $sLong in iana table...\n"; my $sFound = ''; if (defined (my $sTemp = iana_charset_name($sLong))) { $sFound = $sTemp; } # if if ($sFound eq '') { # $iDebug = 1; $iMIB = $sFakeMIB++; push @asMap8Debug, " DDD had to use a dummy mib ($iMIB) for U::Map8==$sLong==\n"; $hsMIBofLongname{$sLong} = $iMIB; } # unless else { $iMIB = $hsMIBofLongname{$sFound}; push @asMap8Debug, " DDD found IANA name $sFound ($iMIB) for Map8 entry $sLong\n"; } # Make this IANA mib map to this Map8 name: push @asMap8Debug, " DDD map $iMIB to $sLong in MIBtoMAP8...\n"; $MIBtoMAP8{$iMIB} = $sLong; my $s = _strip($sLong); push @asMap8Debug, " DDD map $s to $iMIB in hsMIBofShortname...\n"; $hsMIBofShortname{$s} = $iMIB; } # foreach } # if # Now, go through the Unicode::Map8 aliases hash and process the aliases: my $avoid_warning = keys %Unicode::Map8::ALIASES; while (my ($alias, $charset) = each %Unicode::Map8::ALIASES) { my $iMIB = charset_name_to_mib($charset); # qqq my $s = _strip($alias); push @asMap8Debug, " DDD map $s to $iMIB in hsMIBofShortname...\n"; $hsMIBofShortname{$s} = $iMIB; } # while # If there are special cases for Unicode::Map8, add them here: add_map8_alias('ISO_8859-13:1998', 'ISO_8859-13'); add_map8_alias('L 7', 'ISO_8859-13'); add_map8_alias('Latin 7', 'ISO_8859-13'); add_map8_alias('ISO_8859-15:1998', 'ISO_8859-15'); add_map8_alias('L 0', 'ISO_8859-15'); add_map8_alias('Latin 0', 'ISO_8859-15'); add_map8_alias('L 9', 'ISO_8859-15'); add_map8_alias('Latin 9', 'ISO_8859-15'); add_map8_alias('ISO-8859-1-Windows-3.1-Latin-1', 'cp1252'); add_map8_alias('csWindows31Latin1', 'cp1252'); # Above aliases were described in RT#18802 push @asMap8Debug, "done.\n"; print STDERR @asMap8Debug if $iDebug; } # if Unicode::Map8 installed # last; # for debugging # $iDebug = 1; if (eval "require Unicode::Map") { print STDERR " + found Unicode::Map installed, will build tables..." if $iDebug; my $MAP_Path = $INC{'Unicode/Map.pm'}; $MAP_Path =~ s/\.pm//; my $sMapFile = "$MAP_Path/REGISTRY"; if (open MAPS, $sMapFile) { local $/ = undef; my @asMAPS = split(/\n\s*\n/, ); UMAP_ENTRY: foreach my $sEntry (@asMAPS) { $iDebug = 0; # print STDERR " + working on Umap entry >>>>>$sEntry<<<<<...\n"; my ($sName, $iMIB) = ('', ''); # Get the value of the name field, and skip entries with no name: next UMAP_ENTRY unless $sEntry =~ m!^name:\s+(\S+)!mi; $sName = $1; # $iDebug = ($sName =~ m!apple!); print STDERR " + UMAP sName is $sName\n" if $iDebug; my @asAlias = split /\n/, $sEntry; @asAlias = map { /alias:\s+(.*)/; $1 } (grep /alias/, @asAlias); # See if this entry already has the MIB identified: if ($sEntry =~ m!^#mib:\s+(\d+)!mi) { $iMIB = $1; } # if else { # This entry does not have the MIB listed. See if the name # of any of the aliases are known to our iana tables: UMAP_ALIAS: foreach my $sAlias ($sName, @asAlias) { print STDERR " + try alias $sAlias\n" if $iDebug; my $iMIBtry = _short_to_mib(_strip($sAlias)); if ($iMIBtry) { print STDERR " + matched\n" if $iDebug; $iMIB = $iMIBtry; last UMAP_ALIAS; } # if } # foreach # If nothing matched, create a dummy mib: if ($iMIB eq '') { $iMIB = $sFakeMIB++; print STDERR " + had to use a dummy mib ($iMIB) for U::Map==$sName==\n" if $iDebug; } # if } # else # $iDebug = ($iMIB =~ m!225[23]!); # $iDebug = ($iMIB eq '17'); print STDERR " + UMAP mib is $iMIB\n" if $iDebug; $MIBtoUMAP{$iMIB} = $sName; $hsMIBofLongname{$sName} ||= $iMIB; $hsMIBofShortname{_strip($sName)} ||= $iMIB; foreach my $sAlias (@asAlias) { print STDERR " + UMAP alias $sAlias\n" if $iDebug; $hsMIBofShortname{_strip($sAlias)} = $iMIB; } # foreach $sAlias } # foreach UMAP_ENTRY close MAPS; # print STDERR "\n + MIBtoUMAP{dummymib029} == $MIBtoUMAP{$sDummy .'029'}\n\n"; } # if open else { carp " --- couldn't open $sMapFile for read" if $iDebug; } # If there are special cases for Unicode::Map, add them here: # add_umap_alias("new-name", "existing-name"); print STDERR "done.\n" if $iDebug; } # if Unicode::Map installed # Make sure to do U::MapUTF8 last, because it (in turn) depends on # the others. # $iDebug = 1; if (1.0 <= (eval q{ require Unicode::MapUTF8; $Unicode::MapUTF8::VERSION } || 0)) { print STDERR " + found Unicode::MapUTF8 $Unicode::MapUTF8::VERSION installed, will build tables...\n" if $iDebug; my @as; # Wrap this in an eval to avoid compiler warning(?): eval { @as = Unicode::MapUTF8::utf8_supported_charset() }; UMU8_NAME: foreach my $sName (@as) { # $iDebug = ($sName =~ m!jis!i); print STDERR " + working on UmapUTF8 entry >>>>>$sName<<<<<...\n" if $iDebug; my $s = iana_charset_name($sName) || ''; if ($s ne '') { # print STDERR " + iana name is >>>>>$s<<<<<...\n" if $iDebug; $MIBtoUMU8{charset_name_to_mib($s)} = $sName; next UMU8_NAME; } # if already maps to IANA # print STDERR " + UmapUTF8 entry ===$sName=== has no iana entry\n" if $iDebug; $s = umap_charset_name($sName) || ''; if ($s ne '') { print STDERR " + U::Map name is >>>>>$s<<<<<...\n" if $iDebug; $MIBtoUMU8{charset_name_to_mib($s)} = $sName; next UMU8_NAME; } # if maps to U::Map # print STDERR " + UmapUTF8 entry ==$sName== has no U::Map entry\n" if $iDebug; $s = map8_charset_name($sName) || ''; if ($s ne '') { print STDERR " + U::Map8 name is >>>>>$s<<<<<...\n" if $iDebug; $MIBtoUMU8{charset_name_to_mib($s)} = $sName; next UMU8_NAME; } # if maps to U::Map8 print STDERR " + UmapUTF8 entry ==$sName== has no entries at all\n" if $iDebug; } # foreach # If there are special cases for Unicode::MapUTF8, add them here: # add_umap_alias("new-name", "existing-name"); print STDERR "done.\n" if $iDebug; } # if Unicode::MapUTF8 installed # Initialization is all finished: last; # Below here is debugging code: print STDERR " + the following IANA names do *not* have entries in the Map8 table:\n"; my %hiTried = (); foreach my $sIANA (sort values %hsLongnameOfMIB) { next if $hiTried{$sIANA}; print "$sIANA\n" unless defined map8_charset_name($sIANA); $hiTried{$sIANA}++; } # foreach # last; # for debugging # debugging: selective dump: print STDERR " + after init, iana_charset_name returns:\n"; foreach my $key (qw(cp1251 windows-1251 WinCyrillic sjis x-sjis Shift_JIS ASCII US-ASCII us-ascii iso-2022-jp iso-8859-1 Unicode-2-0-utf-8 EUC-KR big5 x-x-big5)) { print STDERR " + $key => ", iana_charset_name($key) || 'undef', "\n"; } # foreach # exit 88; print STDERR " + after init, map8_charset_name() returns:\n"; foreach my $key (qw(cp1251 windows-1251 WinCyrillic sjis x-sjis Shift_JIS ASCII US-ASCII us-ascii iso-2022-jp iso-8859-1 Unicode-2-0-utf-8 EUC-KR big5 x-x-big5)) { print STDERR " + $key => ", map8_charset_name($key) || 'undef', "\n"; } # foreach last; # debugging: huge dump: # _dump_hash('hsLongnameOfMIB', \%hsLongnameOfMIB); # _dump_hash('hsMIBofLongname', \%hsMIBofLongname); # _dump_hash('hsMIBofShortname', \%hsMIBofShortname); foreach (keys %hsMIBofShortname) { print STDERR " + _short_to_long($_) == ", _short_to_long($_) || 'undef', "\n"; } # foreach } # end of INITIALIZATION block sub _dump_hash { my ($sName, $rh) = @_; print STDERR " + after initialization, $sName is:\n"; foreach my $key (keys %$rh) { print STDERR " + $key => $$rh{$key}\n"; } # foreach } # _dump_hash sub _init_data_extra { # This little piece of data is a hand-made list of IANA names and # aliases, in the form AAA === BBB === CCC, where AAA is the # canonical IANA name and BBB and CCC are aliases. Note that # capitalization and punctuation of aliases are meaningless (but # whitespace is not allowed). return <<'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; Shift_JIS === sjis windows-1250 === winlatin2 === cp1250 windows-1251 === wincyrillic === cp1251 windows-1252 === winlatin1 === cp1252 windows-1253 === wingreek === cp1253 windows-1254 === winturkish === cp1254 windows-1255 === winhebrew === cp1255 windows-1256 === winarabic === cp1256 windows-1257 === winbaltic === cp1257 windows-1258 === winvietnamese === cp1258 Adobe-Standard-Encoding === adobe-standard Adobe-Symbol-Encoding === adobe-symbol EBCDIC-ES === ebcdic-cp-es EBCDIC-FR === ebcdic-cp-fr EBCDIC-IT === ebcdic-cp-it EBCDIC-UK === ebcdic-cp-gb EBCDIC-FI-SE === ebcdic-cp-fi UTF-7 === Unicode-2-0-utf-7 UTF-8 === Unicode-2-0-utf-8 Extended_UNIX_Code_Packed_Format_for_Japanese === euc === euc-jp # These are for Unicode::MapUTF8: ISO-10646-UCS-2 === ucs2 ISO-10646-UCS-4 === ucs4 # These are for iconv: ISO-2022-JP === ISO-2022-JP-1 # These are for Encode: IBM1047 === cp1047 GB2312 === gb2312-raw HZ-GB-2312 === hz JIS_X0201 === jis0201-raw JIS_C6226-1983 === jis0208-raw JIS_X0212-1990 === jis0212-raw KS_C_5601-1987 === ksc5601-raw CP037 === CP37 cp863 === DOSCanadaF cp860 === DOSPortuguese cp869 === DOSGreek2 koi8-r === cp878 # These encodings are handled by Encode, but I don't know what they are: # ??? === AdobeZdingbats # ??? === MacArabic # ??? === MacCentralEurRoman # ??? === MacChineseSimp # ??? === MacChineseTrad # ??? === MacCroatian # ??? === MacCyrillic # ??? === MacDingbats # ??? === MacFarsi # ??? === MacGreek # ??? === MacHebrew # ??? === MacIcelandic # ??? === MacJapanese # ??? === MacKorean # ??? === MacRomanian # ??? === MacRumanian # ??? === MacSami # ??? === MacThai # ??? === MacTurkish # ??? === MacUkrainian # ??? === MacVietnamese # ??? === cp1006 # ??? === dingbats # ??? === nextstep # ??? === posix-bc # The following aliases are listed in RT#18802: ISO-8859-10 === 8859-10 === ISO_8859-10:1993 # TCVN-5712 x-viet-tcvn viet-tcvn VN-1 TCVN-5712:1993 TIS-620 === TIS_620-2553 === TIS_620-2553:1990 # VPS x-viet-vps viet-vps # The above aliases are listed in RT#18802 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX } # _init_data_extra sub _init_data { # This big piece of data is the original document from # http://www.iana.org/assignments/character-sets return <<'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE'; 2021-01-04 Character Sets Character Sets Character Sets Expert Review Ned Freed (primary), Martin Dürst (secondary) These are the official names for character sets that may be used in the Internet and may be referred to in Internet documentation. These names are expressed in ANSI_X3.4-1968 which is commonly called US-ASCII or simply ASCII. The character set most commonly use in the Internet and used especially in protocol standards is US-ASCII, this is strongly encouraged. The use of the name US-ASCII is also encouraged. The character set names may be up to 40 characters taken from the printable characters of US-ASCII. However, no distinction is made between use of upper and lower case letters. The MIBenum value is a unique value for use in MIBs to identify coded character sets. The value space for MIBenum values has been divided into three regions. The first region (3-999) consists of coded character sets that have been standardized by some standard setting organization. This region is intended for standards that do not have subset implementations. The second region (1000-1999) is for the Unicode and ISO/IEC 10646 coded character sets together with a specification of a (set of) sub-repertoires that may occur. The third region (>1999) is intended for vendor specific coded character sets. Assigned MIB enum Numbers ------------------------- 0-2 Reserved 3-999 Set By Standards Organizations 1000-1999 Unicode / 10646 2000-2999 Vendor The aliases that start with "cs" have been added for use with the IANA-CHARSET-MIB as originally defined in , and as currently maintained by IANA at . Note that the ianacharset-mib needs to be kept in sync with this registry. These aliases that start with "cs" contain the standard numbers along with suggestive names in order to facilitate applications that want to display the names in user interfaces. The "cs" stands for character set and is provided for applications that need a lower case first letter but want to use mixed case thereafter that cannot contain any special characters, such as underbar ("_") and dash ("-"). If the character set is from an ISO standard, its cs alias is the ISO standard number or name. If the character set is not from an ISO standard, but is registered with ISO (IPSJ/ITSCJ is the current ISO Registration Authority), the ISO Registry number is specified as ISOnnn followed by letters suggestive of the name or standards number of the code set. When a national or international standard is revised, the year of revision is added to the cs alias of the new character set entry in the IANA Registry in order to distinguish the revised character set from the original character set. US-ASCII 3 ANSI X3.4-1986 iso-ir-6 ANSI_X3.4-1968 ANSI_X3.4-1986 ISO_646.irv:1991 ISO646-US US-ASCII us IBM367 cp367 csASCII US-ASCII ISO_8859-1:1987 4 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-100 ISO_8859-1 ISO-8859-1 latin1 l1 IBM819 CP819 csISOLatin1 ISO-8859-1
ISO_8859-2:1987 5 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-101 ISO_8859-2 ISO-8859-2 latin2 l2 csISOLatin2 ISO-8859-2
ISO_8859-3:1988 6 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-109 ISO_8859-3 ISO-8859-3 latin3 l3 csISOLatin3 ISO-8859-3
ISO_8859-4:1988 7 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-110 ISO_8859-4 ISO-8859-4 latin4 l4 csISOLatin4 ISO-8859-4
ISO_8859-5:1988 8 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-144 ISO_8859-5 ISO-8859-5 cyrillic csISOLatinCyrillic ISO-8859-5
ISO_8859-6:1987 9 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-127 ISO_8859-6 ISO-8859-6 ECMA-114 ASMO-708 arabic csISOLatinArabic ISO-8859-6
ISO_8859-7:1987 10 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-126 ISO_8859-7 ISO-8859-7 ELOT_928 ECMA-118 greek greek8 csISOLatinGreek ISO-8859-7
ISO_8859-8:1988 11 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-138 ISO_8859-8 ISO-8859-8 hebrew csISOLatinHebrew ISO-8859-8
ISO_8859-9:1989 12 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-148 ISO_8859-9 ISO-8859-9 latin5 l5 csISOLatin5 ISO-8859-9
ISO-8859-10 13 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-157 l6 ISO_8859-10:1992 csISOLatin6 latin6 ISO-8859-10
ISO_6937-2-add 14 ISO-IR: International Register of Escape Sequences and ISO 6937-2:1983
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-142 csISOTextComm
JIS_X0201 15 JIS X 0201-1976. One byte only, this is equivalent to JIS/Roman (similar to ASCII) plus eight-bit half-width Katakana X0201 csHalfWidthKatakana JIS_Encoding 16 JIS X 0202-1991. Uses ISO 2022 escape sequences to shift code sets as documented in JIS X 0202-1991. csJISEncoding Shift_JIS 17 This charset is an extension of csHalfWidthKatakana by adding graphic characters in JIS X 0208. The CCS's are JIS X0201:1997 and JIS X0208:1997. The complete definition is shown in Appendix 1 of JIS X0208:1997. This charset can be used for the top-level media type "text". MS_Kanji csShiftJIS Shift_JIS Extended_UNIX_Code_Packed_Format_for_Japanese 18 Standardized by OSF, UNIX International, and UNIX Systems Laboratories Pacific. Uses ISO 2022 rules to select code set 0: US-ASCII (a single 7-bit byte set) code set 1: JIS X0208-1990 (a double 8-bit byte set) restricted to A0-FF in both bytes code set 2: Half Width Katakana (a single 7-bit byte set) requiring SS2 as the character prefix code set 3: JIS X0212-1990 (a double 7-bit byte set) restricted to A0-FF in both bytes requiring SS3 as the character prefix csEUCPkdFmtJapanese EUC-JP EUC-JP Extended_UNIX_Code_Fixed_Width_for_Japanese 19 Used in Japan. Each character is 2 octets. code set 0: US-ASCII (a single 7-bit byte set) 1st byte = 00 2nd byte = 20-7E code set 1: JIS X0208-1990 (a double 7-bit byte set) restricted to A0-FF in both bytes code set 2: Half Width Katakana (a single 7-bit byte set) 1st byte = 00 2nd byte = A0-FF code set 3: JIS X0212-1990 (a double 7-bit byte set) restricted to A0-FF in the first byte and 21-7E in the second byte csEUCFixWidJapanese BS_4730 20 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-4 ISO646-GB gb uk csISO4UnitedKingdom
SEN_850200_C 21 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-11 ISO646-SE2 se2 csISO11SwedishForNames
IT 22 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-15 ISO646-IT csISO15Italian
ES 23 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-17 ISO646-ES csISO17Spanish
DIN_66003 24 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-21 de ISO646-DE csISO21German
NS_4551-1 25 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-60 ISO646-NO no csISO60DanishNorwegian csISO60Norwegian1
NF_Z_62-010 26 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-69 ISO646-FR fr csISO69French
ISO-10646-UTF-1 27 Universal Transfer Format (1), this is the multibyte encoding, that subsets ASCII-7. It does not have byte ordering issues. csISO10646UTF1 ISO_646.basic:1983 28 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
ref csISO646basic1983
INVARIANT 29 csINVARIANT ISO_646.irv:1983 30 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-2 irv csISO2IntlRefVersion
NATS-SEFI 31 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-8-1 csNATSSEFI
NATS-SEFI-ADD 32 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-8-2 csNATSSEFIADD
NATS-DANO 33 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-9-1 csNATSDANO
NATS-DANO-ADD 34 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-9-2 csNATSDANOADD
SEN_850200_B 35 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-10 FI ISO646-FI ISO646-SE se csISO10Swedish
KS_C_5601-1987 36 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-149 KS_C_5601-1989 KSC_5601 korean csKSC56011987
ISO-2022-KR 37 (see also KS_C_5601-1987) csISO2022KR ISO-2022-KR EUC-KR 38 (see also KS_C_5861-1992) csEUCKR EUC-KR ISO-2022-JP 39 (see also ) csISO2022JP ISO-2022-JP ISO-2022-JP-2 40 csISO2022JP2 ISO-2022-JP-2 JIS_C6220-1969-jp 41 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
JIS_C6220-1969 iso-ir-13 katakana x0201-7 csISO13JISC6220jp
JIS_C6220-1969-ro 42 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-14 jp ISO646-JP csISO14JISC6220ro
PT 43 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-16 ISO646-PT csISO16Portuguese
greek7-old 44 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-18 csISO18Greek7Old
latin-greek 45 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-19 csISO19LatinGreek
NF_Z_62-010_(1973) 46 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-25 ISO646-FR1 csISO25French
Latin-greek-1 47 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-27 csISO27LatinGreek1
ISO_5427 48 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-37 csISO5427Cyrillic
JIS_C6226-1978 49 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-42 csISO42JISC62261978
BS_viewdata 50 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-47 csISO47BSViewdata
INIS 51 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-49 csISO49INIS
INIS-8 52 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-50 csISO50INIS8
INIS-cyrillic 53 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-51 csISO51INISCyrillic
ISO_5427:1981 54 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-54 ISO5427Cyrillic1981 csISO54271981
ISO_5428:1980 55 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-55 csISO5428Greek
GB_1988-80 56 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-57 cn ISO646-CN csISO57GB1988
GB_2312-80 57 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-58 chinese csISO58GB231280
NS_4551-2 58 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
ISO646-NO2 iso-ir-61 no2 csISO61Norwegian2
videotex-suppl 59 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-70 csISO70VideotexSupp1
PT2 60 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-84 ISO646-PT2 csISO84Portuguese2
ES2 61 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-85 ISO646-ES2 csISO85Spanish2
MSZ_7795.3 62 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-86 ISO646-HU hu csISO86Hungarian
JIS_C6226-1983 63 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-87 x0208 JIS_X0208-1983 csISO87JISX0208
greek7 64 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-88 csISO88Greek7
ASMO_449 65 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
ISO_9036 arabic7 iso-ir-89 csISO89ASMO449
iso-ir-90 66 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
csISO90
JIS_C6229-1984-a 67 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-91 jp-ocr-a csISO91JISC62291984a
JIS_C6229-1984-b 68 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-92 ISO646-JP-OCR-B jp-ocr-b csISO92JISC62991984b
JIS_C6229-1984-b-add 69 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-93 jp-ocr-b-add csISO93JIS62291984badd
JIS_C6229-1984-hand 70 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-94 jp-ocr-hand csISO94JIS62291984hand
JIS_C6229-1984-hand-add 71 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-95 jp-ocr-hand-add csISO95JIS62291984handadd
JIS_C6229-1984-kana 72 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-96 csISO96JISC62291984kana
ISO_2033-1983 73 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-98 e13b csISO2033
ANSI_X3.110-1983 74 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-99 CSA_T500-1983 NAPLPS csISO99NAPLPS
T.61-7bit 75 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-102 csISO102T617bit
T.61-8bit 76 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
T.61 iso-ir-103 csISO103T618bit
ECMA-cyrillic 77 ISO registry iso-ir-111 KOI8-E csISO111ECMACyrillic CSA_Z243.4-1985-1 78 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-121 ISO646-CA csa7-1 csa71 ca csISO121Canadian1
CSA_Z243.4-1985-2 79 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-122 ISO646-CA2 csa7-2 csa72 csISO122Canadian2
CSA_Z243.4-1985-gr 80 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-123 csISO123CSAZ24341985gr
ISO_8859-6-E 81 csISO88596E ISO-8859-6-E ISO-8859-6-E ISO_8859-6-I 82 csISO88596I ISO-8859-6-I ISO-8859-6-I T.101-G2 83 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-128 csISO128T101G2
ISO_8859-8-E 84 csISO88598E ISO-8859-8-E ISO-8859-8-E ISO_8859-8-I 85 csISO88598I ISO-8859-8-I ISO-8859-8-I CSN_369103 86 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-139 csISO139CSN369103
JUS_I.B1.002 87 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-141 ISO646-YU js yu csISO141JUSIB1002
IEC_P27-1 88 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-143 csISO143IECP271
JUS_I.B1.003-serb 89 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-146 serbian csISO146Serbian
JUS_I.B1.003-mac 90 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
macedonian iso-ir-147 csISO147Macedonian
greek-ccitt 91 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-150 csISO150 csISO150GreekCCITT
NC_NC00-10:81 92 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
cuba iso-ir-151 ISO646-CU csISO151Cuba
ISO_6937-2-25 93 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-152 csISO6937Add
GOST_19768-74 94 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
ST_SEV_358-88 iso-ir-153 csISO153GOST1976874
ISO_8859-supp 95 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-154 latin1-2-5 csISO8859Supp
ISO_10367-box 96 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
iso-ir-155 csISO10367Box
latin-lap 97 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
lap iso-ir-158 csISO158Lap
JIS_X0212-1990 98 ISO-IR: International Register of Escape Sequences
Note: The current registration authority is IPSJ/ITSCJ, Japan.
x0212 iso-ir-159 csISO159JISX02121990
DS_2089 99 Danish Standard, DS 2089, February 1974 DS2089 ISO646-DK dk csISO646Danish us-dk 100 csUSDK dk-us 101 csDKUS KSC5636 102 ISO646-KR csKSC5636 UNICODE-1-1-UTF-7 103 csUnicode11UTF7 ISO-2022-CN 104 csISO2022CN ISO-2022-CN-EXT 105 csISO2022CNEXT UTF-8 106 csUTF8 ISO-8859-13 109 ISO See csISO885913 ISO-8859-14 110 ISO See iso-ir-199 ISO_8859-14:1998 ISO_8859-14 latin8 iso-celtic l8 csISO885914 ISO-8859-15 111 ISO Please see: ISO_8859-15 Latin-9 csISO885915 ISO-8859-16 112 ISO iso-ir-226 ISO_8859-16:2001 ISO_8859-16 latin10 l10 csISO885916 GBK 113 Chinese IT Standardization Technical Committee Please see: CP936 MS936 windows-936 csGBK GB18030 114 Chinese IT Standardization Technical Committee Please see: csGB18030 OSD_EBCDIC_DF04_15 115 Fujitsu-Siemens standard mainframe EBCDIC encoding Please see: csOSDEBCDICDF0415 OSD_EBCDIC_DF03_IRV 116 Fujitsu-Siemens standard mainframe EBCDIC encoding Please see: csOSDEBCDICDF03IRV OSD_EBCDIC_DF04_1 117 Fujitsu-Siemens standard mainframe EBCDIC encoding Please see: csOSDEBCDICDF041 ISO-11548-1 118 See ISO_11548-1 ISO_TR_11548-1 csISO115481 KZ-1048 119 See STRK1048-2002 RK1048 csKZ1048 ISO-10646-UCS-2 1000 the 2-octet Basic Multilingual Plane, aka Unicode this needs to specify network byte order: the standard does not specify (it is a 16-bit integer space) csUnicode ISO-10646-UCS-4 1001 the full code space. (same comment about byte order, these are 31-bit numbers. csUCS4 ISO-10646-UCS-Basic 1002 ASCII subset of Unicode. Basic Latin = collection 1 See ISO 10646, Appendix A csUnicodeASCII ISO-10646-Unicode-Latin1 1003 ISO Latin-1 subset of Unicode. Basic Latin and Latin-1 Supplement = collections 1 and 2. See ISO 10646, Appendix A. See . csUnicodeLatin1 ISO-10646 ISO-10646-J-1 1004 ISO 10646 Japanese, see . csUnicodeJapanese ISO-Unicode-IBM-1261 1005 IBM Latin-2, -3, -5, Extended Presentation Set, GCSGID: 1261 csUnicodeIBM1261 ISO-Unicode-IBM-1268 1006 IBM Latin-4 Extended Presentation Set, GCSGID: 1268 csUnicodeIBM1268 ISO-Unicode-IBM-1276 1007 IBM Cyrillic Greek Extended Presentation Set, GCSGID: 1276 csUnicodeIBM1276 ISO-Unicode-IBM-1264 1008 IBM Arabic Presentation Set, GCSGID: 1264 csUnicodeIBM1264 ISO-Unicode-IBM-1265 1009 IBM Hebrew Presentation Set, GCSGID: 1265 csUnicodeIBM1265 UNICODE-1-1 1010 csUnicode11 SCSU 1011 SCSU See csSCSU UTF-7 1012 csUTF7 UTF-16BE 1013 csUTF16BE UTF-16LE 1014 csUTF16LE UTF-16 1015 csUTF16 CESU-8 1016 csCESU8 csCESU-8 UTF-32 1017 csUTF32 UTF-32BE 1018 csUTF32BE UTF-32LE 1019 csUTF32LE BOCU-1 1020 csBOCU1 csBOCU-1 UTF-7-IMAP 1021 Note: This charset is used to encode Unicode in IMAP mailbox names; see section 5.1.3 of . It should never be used outside this context. A name has been assigned so that charset processing implementations can refer to it in a consistent way. csUTF7IMAP ISO-8859-1-Windows-3.0-Latin-1 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2000 Extended ISO 8859-1 Latin-1 for Windows 3.0. PCL Symbol Set id: 9U csWindows30Latin1 ISO-8859-1-Windows-3.1-Latin-1 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2001 Extended ISO 8859-1 Latin-1 for Windows 3.1. PCL Symbol Set id: 19U csWindows31Latin1 ISO-8859-2-Windows-Latin-2 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2002 Extended ISO 8859-2. Latin-2 for Windows 3.1. PCL Symbol Set id: 9E csWindows31Latin2 ISO-8859-9-Windows-Latin-5 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2003 Extended ISO 8859-9. Latin-5 for Windows 3.1 PCL Symbol Set id: 5T csWindows31Latin5 hp-roman8 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2004 LaserJet IIP Printer User's Manual, HP part no 33471-90901, Hewlet-Packard, June 1989. roman8 r8 csHPRoman8 Adobe-Standard-Encoding Adobe Systems Incorporated, PostScript Language Reference Manual, second edition, Addison-Wesley Publishing Company, Inc., 1990. 2005 PostScript Language Reference Manual PCL Symbol Set id: 10J csAdobeStandardEncoding Ventura-US Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2006 Ventura US. ASCII plus characters typically used in publishing, like pilcrow, copyright, registered, trade mark, section, dagger, and double dagger in the range A0 (hex) to FF (hex). PCL Symbol Set id: 14J csVenturaUS Ventura-International Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2007 Ventura International. ASCII plus coded characters similar to Roman8. PCL Symbol Set id: 13J csVenturaInternational DEC-MCS 2008 VAX/VMS User's Manual, Order Number: AI-Y517A-TE, April 1986. dec csDECMCS IBM850 2009 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp850 850 csPC850Multilingual PC8-Danish-Norwegian Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2012 PC Danish Norwegian 8-bit PC set for Danish Norwegian PCL Symbol Set id: 11U csPC8DanishNorwegian IBM862 2013 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp862 862 csPC862LatinHebrew PC8-Turkish Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2014 PC Latin Turkish. PCL Symbol Set id: 9T csPC8Turkish IBM-Symbols IBM Corporation, "ABOUT TYPE: IBM's Technical Reference for Core Interchange Digitized Type", Publication number S544-3708-01 2015 Presentation Set, CPGID: 259 csIBMSymbols IBM-Thai IBM Corporation, "ABOUT TYPE: IBM's Technical Reference for Core Interchange Digitized Type", Publication number S544-3708-01 2016 Presentation Set, CPGID: 838 csIBMThai HP-Legal Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2017 PCL 5 Comparison Guide, Hewlett-Packard, HP part number 5961-0510, October 1992 PCL Symbol Set id: 1U csHPLegal HP-Pi-font Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2018 PCL 5 Comparison Guide, Hewlett-Packard, HP part number 5961-0510, October 1992 PCL Symbol Set id: 15U csHPPiFont HP-Math8 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2019 PCL 5 Comparison Guide, Hewlett-Packard, HP part number 5961-0510, October 1992 PCL Symbol Set id: 8M csHPMath8 Adobe-Symbol-Encoding Adobe Systems Incorporated, PostScript Language Reference Manual, second edition, Addison-Wesley Publishing Company, Inc., 1990. 2020 PostScript Language Reference Manual PCL Symbol Set id: 5M csHPPSMath HP-DeskTop Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2021 PCL 5 Comparison Guide, Hewlett-Packard, HP part number 5961-0510, October 1992 PCL Symbol Set id: 7J csHPDesktop Ventura-Math Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2022 PCL 5 Comparison Guide, Hewlett-Packard, HP part number 5961-0510, October 1992 PCL Symbol Set id: 6M csVenturaMath Microsoft-Publishing Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2023 PCL 5 Comparison Guide, Hewlett-Packard, HP part number 5961-0510, October 1992 PCL Symbol Set id: 6J csMicrosoftPublishing Windows-31J 2024 Windows Japanese. A further extension of Shift_JIS to include NEC special characters (Row 13), NEC selection of IBM extensions (Rows 89 to 92), and IBM extensions (Rows 115 to 119). The CCS's are JIS X0201:1997, JIS X0208:1997, and these extensions. This charset can be used for the top-level media type "text", but it is of limited or specialized use (see ). PCL Symbol Set id: 19K csWindows31J GB2312 2025 Chinese for People's Republic of China (PRC) mixed one byte, two byte set: 20-7E = one byte ASCII A1-FE = two byte PRC Kanji See GB 2312-80 PCL Symbol Set Id: 18C csGB2312 GB2312 Big5 2026 Chinese for Taiwan Multi-byte set. PCL Symbol Set Id: 18T csBig5 Big5 macintosh 2027 The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991 mac csMacintosh IBM037 2028 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp037 ebcdic-cp-us ebcdic-cp-ca ebcdic-cp-wt ebcdic-cp-nl csIBM037 IBM038 2029 IBM 3174 Character Set Ref, GA27-3831-02, March 1990 EBCDIC-INT cp038 csIBM038 IBM273 2030 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP273 csIBM273 IBM274 2031 IBM 3174 Character Set Ref, GA27-3831-02, March 1990 EBCDIC-BE CP274 csIBM274 IBM275 2032 IBM NLS RM Vol2 SE09-8002-01, March 1990 EBCDIC-BR cp275 csIBM275 IBM277 2033 IBM NLS RM Vol2 SE09-8002-01, March 1990 EBCDIC-CP-DK EBCDIC-CP-NO csIBM277 IBM278 2034 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP278 ebcdic-cp-fi ebcdic-cp-se csIBM278 IBM280 2035 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP280 ebcdic-cp-it csIBM280 IBM281 2036 IBM 3174 Character Set Ref, GA27-3831-02, March 1990 EBCDIC-JP-E cp281 csIBM281 IBM284 2037 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP284 ebcdic-cp-es csIBM284 IBM285 2038 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP285 ebcdic-cp-gb csIBM285 IBM290 2039 IBM 3174 Character Set Ref, GA27-3831-02, March 1990 cp290 EBCDIC-JP-kana csIBM290 IBM297 2040 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp297 ebcdic-cp-fr csIBM297 IBM420 2041 IBM NLS RM Vol2 SE09-8002-01, March 1990, IBM NLS RM p 11-11 cp420 ebcdic-cp-ar1 csIBM420 IBM423 2042 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp423 ebcdic-cp-gr csIBM423 IBM424 2043 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp424 ebcdic-cp-he csIBM424 IBM437 2011 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp437 437 csPC8CodePage437 IBM500 2044 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP500 ebcdic-cp-be ebcdic-cp-ch csIBM500 IBM851 2045 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp851 851 csIBM851 IBM852 2010 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp852 852 csPCp852 IBM855 2046 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp855 855 csIBM855 IBM857 2047 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp857 857 csIBM857 IBM860 2048 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp860 860 csIBM860 IBM861 2049 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp861 861 cp-is csIBM861 IBM863 2050 IBM Keyboard layouts and code pages, PN 07G4586 June 1991 cp863 863 csIBM863 IBM864 2051 IBM Keyboard layouts and code pages, PN 07G4586 June 1991 cp864 csIBM864 IBM865 2052 IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987) cp865 865 csIBM865 IBM868 2053 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP868 cp-ar csIBM868 IBM869 2054 IBM Keyboard layouts and code pages, PN 07G4586 June 1991 cp869 869 cp-gr csIBM869 IBM870 2055 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP870 ebcdic-cp-roece ebcdic-cp-yu csIBM870 IBM871 2056 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP871 ebcdic-cp-is csIBM871 IBM880 2057 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp880 EBCDIC-Cyrillic csIBM880 IBM891 2058 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp891 csIBM891 IBM903 2059 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp903 csIBM903 IBM904 2060 IBM NLS RM Vol2 SE09-8002-01, March 1990 cp904 904 csIBBM904 IBM905 2061 IBM 3174 Character Set Ref, GA27-3831-02, March 1990 CP905 ebcdic-cp-tr csIBM905 IBM918 2062 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP918 ebcdic-cp-ar2 csIBM918 IBM1026 2063 IBM NLS RM Vol2 SE09-8002-01, March 1990 CP1026 csIBM1026 EBCDIC-AT-DE 2064 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csIBMEBCDICATDE EBCDIC-AT-DE-A 2065 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICATDEA EBCDIC-CA-FR 2066 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICCAFR EBCDIC-DK-NO 2067 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICDKNO EBCDIC-DK-NO-A 2068 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICDKNOA EBCDIC-FI-SE 2069 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICFISE EBCDIC-FI-SE-A 2070 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICFISEA EBCDIC-FR 2071 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICFR EBCDIC-IT 2072 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICIT EBCDIC-PT 2073 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICPT EBCDIC-ES 2074 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICES EBCDIC-ES-A 2075 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICESA EBCDIC-ES-S 2076 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICESS EBCDIC-UK 2077 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICUK EBCDIC-US 2078 IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 csEBCDICUS UNKNOWN-8BIT 2079 csUnknown8BiT MNEMONIC 2080 , also known as "mnemonic+ascii+38" csMnemonic MNEM 2081 , also known as "mnemonic+ascii+8200" csMnem VISCII 2082 csVISCII VIQR 2083 csVIQR KOI8-R 2084 , based on GOST-19768-74, ISO-6937/8, INIS-Cyrillic, ISO-5427. csKOI8R KOI8-R HZ-GB-2312 2085 , IBM866 2086 IBM NLDG Volume 2 (SE09-8002-03) August 1994 cp866 866 csIBM866 IBM775 Hewlett-Packard Company, "HP PCL 5 Comparison Guide", (P/N 5021-0329) pp B-13, 1996. 2087 HP PCL 5 Comparison Guide (P/N 5021-0329) pp B-13, 1996 cp775 csPC775Baltic KOI8-U 2088 csKOI8U IBM00858 2089 IBM See CCSID00858 CP00858 PC-Multilingual-850+euro csIBM00858 IBM00924 2090 IBM See CCSID00924 CP00924 ebcdic-Latin9--euro csIBM00924 IBM01140 2091 IBM See CCSID01140 CP01140 ebcdic-us-37+euro csIBM01140 IBM01141 2092 IBM See CCSID01141 CP01141 ebcdic-de-273+euro csIBM01141 IBM01142 2093 IBM See CCSID01142 CP01142 ebcdic-dk-277+euro ebcdic-no-277+euro csIBM01142 IBM01143 2094 IBM See CCSID01143 CP01143 ebcdic-fi-278+euro ebcdic-se-278+euro csIBM01143 IBM01144 2095 IBM See CCSID01144 CP01144 ebcdic-it-280+euro csIBM01144 IBM01145 2096 IBM See CCSID01145 CP01145 ebcdic-es-284+euro csIBM01145 IBM01146 2097 IBM See CCSID01146 CP01146 ebcdic-gb-285+euro csIBM01146 IBM01147 2098 IBM See CCSID01147 CP01147 ebcdic-fr-297+euro csIBM01147 IBM01148 2099 IBM See CCSID01148 CP01148 ebcdic-international-500+euro csIBM01148 IBM01149 2100 IBM See CCSID01149 CP01149 ebcdic-is-871+euro csIBM01149 Big5-HKSCS 2101 See csBig5HKSCS IBM1047 2102 IBM1047 (EBCDIC Latin 1/Open Systems) IBM-1047 csIBM1047 PTCP154 2103 See csPTCP154 PT154 CP154 Cyrillic-Asian Amiga-1251 2104 See Ami1251 Amiga1251 Ami-1251 csAmiga1251 (Aliases are provided for historical reasons and should not be used) [Malyshev] KOI7-switched 2105 See csKOI7switched BRF 2106 See csBRF TSCII 2107 See csTSCII CP51932 2108 See csCP51932 windows-874 2109 See cswindows874 windows-1250 2250 Microsoft cswindows1250 windows-1251 2251 Microsoft cswindows1251 windows-1252 2252 Microsoft cswindows1252 windows-1253 2253 Microsoft cswindows1253 windows-1254 2254 Microsoft cswindows1254 windows-1255 2255 Microsoft cswindows1255 windows-1256 2256 Microsoft cswindows1256 windows-1257 2257 Microsoft cswindows1257 windows-1258 2258 Microsoft cswindows1258 TIS-620 2259 Thai Industrial Standards Institute (TISI) csTIS620 ISO-8859-11 CP50220 2260 See csCP50220
Alexander Uskov mailto:auskov&idc.kz 2002-09 Alexei Veremeev mailto:Alexey.Veremeev&oracle.com 2006-12-07 Chris Wendt mailto:christw&microsoft.com 1999-12 Florian Weimer mailto:fw&deneb.enyo.de 2021-01-04 Hank Nussbacher mailto:hank&vm.tau.ac.il Internet Assigned Numbers Authority mailto:iana&iana.org Jun Murai mailto:jun&wide.ad.jp Katya Lazhintseva mailto:katyal&microsoft.com 1996-05 Keld Simonsen mailto:Keld&keldix.com 2018-10-19 Keld Simonsen mailto:Keld.Simonsen&rap.dk 2000-08 Kuppuswamy Kalyanasundaram mailto:kalyan.geo&yahoo.com 2007-05-14 Mark Davis mailto:mark&unicode.org 2002-04 Markus Scherer mailto:markus.scherer&jtcsv.com 2002-09 Masataka Ohta mailto:mohta&cc.titech.ac.jp 1995-07 Nicky Yick mailto:cliac&itsd.gcn.gov.hk 2000-10 Reuel Robrigado mailto:reuelr&ca.ibm.com 2002-09 Rick Pond mailto:rickpond&vnet.ibm.com 1997-03 Sairan M. Kikkarin mailto:sairan&sci.kz 2006-12-07 Samuel Thibault mailto:samuel.thibault&ens-lyon.org 2006-12-07 Shawn Steele mailto:Shawn.Steele&microsoft.com 2010-11-04 Tamer Mahdi mailto:tamer&ca.ibm.com 2000-08 Toby Phipps mailto:tphipps&peoplesoft.com 2002-03 Trin Tantsetthi mailto:trin&mozart.inet.co.th 1998-09 Vladas Tumasonis mailto:vladas.tumasonis&maf.vu.lt 2000-08 Woohyong Choi mailto:whchoi&cosmos.kaist.ac.kr Yui Naruse mailto:naruse&airemix.jp 2011-09-23
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE } # _init_data 1; __END__ I18N-Charset-1.419/README0000644000175000017500000000304114006311617014021 0ustar martinmartin I18N-Charset Distribution This distribution contains a module I18N::Charset which maps Character Set names to the names officially registered with IANA. For example, 'Shift_JIS' is the official name of what is often referred to in HTML headers as 'x-sjis'. It also maps character set names to Unicode::Map, Unicode::Map8, and Unicode::MapUTF8 conversion scheme names (if those modules are installed). For example, the Unicode::Map8 scheme name for 'windows-1251' is 'cp1251'. It also maps character set names to their preferred MIME names. For example, the preferred MIME name for 'ISO_646.irv:1991' is 'US-ASCII'. It also maps character set names to conversion scheme names as defined by the iconv library. For example, the iconv conversion scheme name for 'Shift_JIS' is 'MS_KANJI'. It also maps character set names to encoding names as defined by the Encode module. For example, the Encode encoding name for 'Shift_JIS' is 'shiftjis'. To install these modules, you should just have to run the following: % perl Makefile.PL % make test % make install (If you're on a Windows system, you probably use Nmake instead of make.) The module is documented using pod. When you "make install", you will get a man page I18N::Charset which can be displayed by "perldoc I18N::Charset". Please let me know if you experience any problems with this module, or have any ideas for additions, or if you have some new character set names or abbreviations you'd like to be included. Martin Thurn, , L. I18N-Charset-1.419/README.md0000644000175000017500000000005114006311617014416 0ustar martinmartin# I18N-Charset Perl module I18N::Charset I18N-Charset-1.419/Makefile.PL0000644000175000017500000000207714006311617015123 0ustar martinmartin use lib '.'; use inc::Module::Install; my $sFnamePM = q{lib/I18N/Charset.pm}; all_from($sFnamePM); requires( perl => '5.005' ); recommends('App::Info::Lib::Iconv'); recommends('Encode'); test_requires('IO::Capture::Stderr' => 0); recommends('Jcode'); recommends('Unicode::Map'); recommends('Unicode::Map8'); recommends('Unicode::MapUTF8'); # Test::More is needed for `make test`: test_requires('Test::More'); recommends('Test::Pod'); recommends('Test::Pod::Coverage'); sub MY::postamble { my $ret = <<'PART0'; coverage : $(MAKE) HARNESS_PERL_SWITCHES=-MDevel::Cover coverage_slave coverage_slave : test cover PART0 my $sFnameIANA = q{IANA-docs/character-sets}; if (-f $sFnameIANA) { # This must be the author's environment $ret .= <<"PART1"; CHARSETPM = $sFnamePM IANA = $sFnameIANA prep : \$(CHARSETPM) \$(CHARSETPM) : \$(IANA) \$(FULLPERL) prep.pl \$(IANA) \$@ PART1 } # if return $ret; } # MY::postamble use Env; if ($ENV{MTHURN_PERL_DEV}) { warn "DDD This is author's development environment\n"; use_ptar(); } # if WriteAll; __END__ I18N-Charset-1.419/MANIFEST0000644000175000017500000000066514006315124014300 0ustar martinmartinChanges inc/Module/Install.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/I18N/Charset.pm Makefile.PL MANIFEST This list of files META.yml README README.md t/bug1.t t/enco.t t/iana.t t/libi.t t/map8.t t/mib.t t/mime.t t/pod-coverage.t t/pod.t t/rt33087.t t/umap.t t/utf8.t