utf8-all-0.011/0000775000175000017500000000000012177207705011615 5ustar mikemikeutf8-all-0.011/xt/0000775000175000017500000000000012177207705012250 5ustar mikemikeutf8-all-0.011/xt/release/0000775000175000017500000000000012177207705013670 5ustar mikemikeutf8-all-0.011/xt/release/minimum-version.t0000644000175000017500000000026712177207705017216 0ustar mikemike#!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.10.1} ); utf8-all-0.011/xt/release/pod-linkcheck.t0000644000175000017500000000053712177207705016573 0ustar mikemike#!perl use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } utf8-all-0.011/xt/release/dist-manifest.t0000644000175000017500000000023012177207705016615 0ustar mikemike#!perl use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); utf8-all-0.011/xt/release/cpan-changes.t0000644000175000017500000000026312177207705016403 0ustar mikemike#!perl use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); utf8-all-0.011/xt/release/pod-coverage.t0000644000175000017500000000052712177207705016432 0ustar mikemike#!perl use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); utf8-all-0.011/xt/release/test-version.t0000644000175000017500000000064312177207705016520 0ustar mikemikeuse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 0.002004 BEGIN { eval "use Test::Version; 1;" or die $@; } my @imports = ( 'version_all_ok' ); my $params = { is_strict => 0, has_version => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; utf8-all-0.011/xt/release/unused-vars.t0000644000175000017500000000020712177207705016326 0ustar mikemike#!perl use Test::More; eval "use Test::Vars"; plan skip_all => "Test::Vars required for testing unused vars" if $@; all_vars_ok(); utf8-all-0.011/xt/release/pod-syntax.t0000644000175000017500000000021212177207705016154 0ustar mikemike#!perl use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); utf8-all-0.011/xt/release/meta-json.t0000644000175000017500000000023312177207705015746 0ustar mikemike#!perl use Test::More; eval 'use Test::CPAN::Meta::JSON'; plan skip_all => 'Test::CPAN::Meta::JSON required for testing META.json' if $@; meta_json_ok(); utf8-all-0.011/xt/release/distmeta.t0000644000175000017500000000021712177207705015665 0ustar mikemike#!perl use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; meta_yaml_ok(); utf8-all-0.011/xt/release/kwalitee.t0000644000175000017500000000036112177207705015660 0ustar mikemike#!perl # This test is generated by Dist::Zilla::Plugin::Test::Kwalitee use strict; use warnings; use Test::More; # needed to provide plan. eval "use Test::Kwalitee"; plan skip_all => "Test::Kwalitee required for testing kwalitee" if $@; utf8-all-0.011/xt/release/mojibake.t0000644000175000017500000000040612177207705015634 0ustar mikemike#!perl use strict; use warnings qw(all); use Test::More; ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) eval q(use Test::Mojibake); plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; all_files_encoding_ok(); utf8-all-0.011/xt/release/synopsis.t0000644000175000017500000000022012177207705015734 0ustar mikemike#!perl use Test::More; eval "use Test::Synopsis"; plan skip_all => "Test::Synopsis required for testing synopses" if $@; all_synopsis_ok(); utf8-all-0.011/xt/release/no-tabs.t0000644000175000017500000000021212177207705015411 0ustar mikemikeuse strict; use warnings; use Test::More; eval 'use Test::NoTabs'; plan skip_all => 'Test::NoTabs required' if $@; all_perl_files_ok(); utf8-all-0.011/xt/author/0000775000175000017500000000000012177207705013552 5ustar mikemikeutf8-all-0.011/xt/author/test-eol.t0000644000175000017500000000036412177207705015474 0ustar mikemikeuse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::EOL 0.07 eval "use Test::EOL; 1;" or die $@; # ^^ hack to get around prereqscanner detection, remove someday all_perl_files_ok({ trailing_whitespace => 1 }); utf8-all-0.011/xt/author/critic.t0000644000175000017500000000043512177207705015214 0ustar mikemike#!perl use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); utf8-all-0.011/lib/0000775000175000017500000000000012177207705012363 5ustar mikemikeutf8-all-0.011/lib/utf8/0000775000175000017500000000000012177207705013251 5ustar mikemikeutf8-all-0.011/lib/utf8/all/0000775000175000017500000000000012177207705014021 5ustar mikemikeutf8-all-0.011/lib/utf8/all/Conflicts.pm0000644000175000017500000000256412177207705016310 0ustar mikemikepackage # hide from PAUSE utf8::all::Conflicts; use strict; use warnings; use Dist::CheckConflicts -dist => 'utf8::all', -conflicts => { 'autodie' => '2.11', }, ; 1; # ABSTRACT: Provide information on conflicts for utf8::all __END__ =pod =encoding utf-8 =head1 NAME utf8::all::Conflicts - Provide information on conflicts for utf8::all =head1 VERSION version 0.011 =head1 AVAILABILITY The project homepage is L. The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit L to find a CPAN site near you, or see L. =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at L. =head1 AUTHORS =over 4 =item * Michael Schwern =item * Mike Doherty =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut utf8-all-0.011/lib/utf8/all.pm0000644000175000017500000001043112177207705014354 0ustar mikemikepackage utf8::all; use strict; use warnings; use 5.010; # state # ABSTRACT: turn on Unicode - all of it our $VERSION = '0.011'; # VERSION use Import::Into; use parent qw(Encode charnames utf8 open warnings feature); use Symbol qw/qualify_to_ref/; sub import { my $target = caller; 'utf8'->import::into($target); 'open'->import::into($target, qw{:encoding(UTF-8) :std}); 'charnames'->import::into($target, qw{:full :short}); 'warnings'->import::into($target, qw{FATAL utf8}); 'feature'->import::into($target, qw{unicode_strings}) if $^V >= v5.11.0; 'feature'->import::into($target, qw{unicode_eval fc}) if $^V >= v5.16.0; { no strict qw(refs); ## no critic (TestingAndDebugging::ProhibitNoStrict) *{$target . '::readdir'} = \&_utf8_readdir; } # utf8 in @ARGV state $have_encoded_argv = 0; _encode_argv() unless $have_encoded_argv++; $^H{'utf8::all'} = 1; return; } sub _encode_argv { $_ = Encode::decode('UTF-8', $_) for @ARGV; return; } sub _utf8_readdir(*) { ## no critic (Subroutines::ProhibitSubroutinePrototypes) my $pre_handle = shift; my $handle = ref($pre_handle) ? $pre_handle : qualify_to_ref($pre_handle, caller); my $hints = (caller 0)[10]; if (wantarray) { my @all_files = CORE::readdir($handle); return @all_files if not $hints->{'utf8::all'}; $_ = Encode::decode('UTF-8', $_) for @all_files; return @all_files; } else { my $next_file = CORE::readdir($handle); $next_file = Encode::decode('UTF-8', $next_file) if $hints->{'utf8::all'}; return $next_file; } } 1; __END__ =pod =encoding utf-8 =head1 NAME utf8::all - turn on Unicode - all of it =head1 VERSION version 0.011 =head1 SYNOPSIS use utf8::all; # Turn on UTF-8. All of it. open my $in, '<', 'contains-utf8'; # UTF-8 already turned on here print length 'føø bār'; # 7 UTF-8 characters my $utf8_arg = shift @ARGV; # @ARGV is UTF-8 too! =head1 DESCRIPTION L allows you to write your Perl encoded in UTF-8. That means UTF-8 strings, variable names, and regular expressions. C goes further, and makes C<@ARGV> encoded in UTF-8, and filehandles are opened with UTF-8 encoding turned on by default (including STDIN, STDOUT, STDERR), and charnames are imported so C<\N{...}> sequences can be used to compile Unicode characters based on names. If you I want UTF-8 for a particular filehandle, you'll have to set C. The pragma is lexically-scoped, so you can do the following if you had some reason to: { use utf8::all; open my $out, '>', 'outfile'; my $utf8_str = 'føø bār'; print length $utf8_str, "\n"; # 7 print $out $utf8_str; # out as utf8 } open my $in, '<', 'outfile'; # in as raw my $text = do { local $/; <$in>}; print length $text, "\n"; # 10, not 7! =head1 INTERACTION WITH AUTODIE If you use L, which is a great idea, you need to use at least version B<2.12>, released on L. Otherwise, autodie obliterates the IO layers set by the L pragma. See L and L. =head1 AVAILABILITY The project homepage is L. The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit L to find a CPAN site near you, or see L. =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at L. =head1 AUTHORS =over 4 =item * Michael Schwern =item * Mike Doherty =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut utf8-all-0.011/corpus/0000775000175000017500000000000012177207705013130 5ustar mikemikeutf8-all-0.011/corpus/みかちゃん0000644000175000017500000000000012177207705020105 0ustar mikemikeutf8-all-0.011/corpus/testfile0000644000175000017500000000000612177207705014664 0ustar mikemikeføø utf8-all-0.011/MANIFEST.SKIP0000644000175000017500000000147012177207705013513 0ustar mikemike# Avoid version control files. \bRCS\b \bCVS\b \bSCCS\b ,v$ \B\.svn\b \B\.git\b \B\.gitignore\b \b_darcs\b \B\.cvsignore$ # Avoid VMS specific MakeMaker generated files \bDescrip.MMS$ \bDESCRIP.MMS$ \bdescrip.mms$ # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ \bBuild.bat$ \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ \.tmp$ \.# \.rej$ # Avoid OS-specific files/dirs # Mac OSX metadata \B\.DS_Store # Mac OSX SMB mount metadata files \B\._ # Avoid Devel::Cover and Devel::CoverX::Covered files. \bcover_db\b \bcovered\b # Avoid MYMETA files ^MYMETA\. utf8-all-0.011/Makefile.PL0000644000175000017500000000525212177207705013571 0ustar mikemike use strict; use warnings; use 5.010; use ExtUtils::MakeMaker 6.30; check_conflicts(); my %WriteMakefileArgs = ( "ABSTRACT" => "turn on Unicode - all of it", "AUTHOR" => "Michael Schwern , Mike Doherty ", "BUILD_REQUIRES" => { "Module::Build" => "0.3601" }, "CONFIGURE_REQUIRES" => { "Dist::CheckConflicts" => "0.02", "Module::Build" => "0.3601" }, "DISTNAME" => "utf8-all", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "utf8::all", "PREREQ_PM" => { "Dist::CheckConflicts" => "0.02", "Encode" => 0, "Import::Into" => 0, "Symbol" => 0, "charnames" => 0, "feature" => 0, "open" => 0, "parent" => 0, "strict" => 0, "utf8" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Capture::Tiny" => 0, "PerlIO" => 0, "Test::Fatal" => 0, "Test::More" => "0.96", "Test::Warn" => 0, "autodie" => 0, "version" => "0.77" }, "VERSION" => "0.011", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); sub check_conflicts { if ( eval { require 'lib/utf8/all/Conflicts.pm'; 1; } ) { if ( eval { utf8::all::Conflicts->check_conflicts; 1 } ) { return; } else { my $err = $@; $err =~ s/^/ /mg; warn "***\n$err***\n"; } } else { print <<'EOF'; *** Your toolchain doesn't support configure_requires, so Dist::CheckConflicts hasn't been installed yet. You should check for conflicting modules manually by examining the list of conflicts in utf8::all::Conflicts once the installation finishes. *** EOF } return if $ENV{AUTOMATED_TESTING} || $ENV{NONINTERACTIVE_TESTING}; # More or less copied from Module::Build return if $ENV{PERL_MM_USE_DEFAULT}; return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); sleep 4; } utf8-all-0.011/README.mkdn0000644000175000017500000000556712177207705013440 0ustar mikemike# NAME utf8::all - turn on Unicode - all of it # VERSION version 0.011 # SYNOPSIS use utf8::all; # Turn on UTF-8. All of it. open my $in, '<', 'contains-utf8'; # UTF-8 already turned on here print length 'føø bār'; # 7 UTF-8 characters my $utf8_arg = shift @ARGV; # @ARGV is UTF-8 too! # DESCRIPTION [utf8](http://search.cpan.org/perldoc?utf8) allows you to write your Perl encoded in UTF-8. That means UTF-8 strings, variable names, and regular expressions. `utf8::all` goes further, and makes `@ARGV` encoded in UTF-8, and filehandles are opened with UTF-8 encoding turned on by default (including STDIN, STDOUT, STDERR), and charnames are imported so `\N{...}` sequences can be used to compile Unicode characters based on names. If you _don't_ want UTF-8 for a particular filehandle, you'll have to set `binmode $filehandle`. The pragma is lexically-scoped, so you can do the following if you had some reason to: { use utf8::all; open my $out, '>', 'outfile'; my $utf8_str = 'føø bār'; print length $utf8_str, "\n"; # 7 print $out $utf8_str; # out as utf8 } open my $in, '<', 'outfile'; # in as raw my $text = do { local $/; <$in>}; print length $text, "\n"; # 10, not 7! # INTERACTION WITH AUTODIE If you use [autodie](http://search.cpan.org/perldoc?autodie), which is a great idea, you need to use at least version __2.12__, released on [June 26, 2012](https://metacpan.org/source/PJF/autodie-2.12/Changes\#L3). Otherwise, autodie obliterates the IO layers set by the [open](http://search.cpan.org/perldoc?open) pragma. See [RT \#54777](https://rt.cpan.org/Ticket/Display.html?id=54777) and [GH \#7](https://github.com/doherty/utf8-all/issues/7). # AVAILABILITY The project homepage is [http://metacpan.org/release/utf8-all/](http://metacpan.org/release/utf8-all/). The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit [http://www.perl.com/CPAN/](http://www.perl.com/CPAN/) to find a CPAN site near you, or see [https://metacpan.org/module/utf8::all/](https://metacpan.org/module/utf8::all/). # SOURCE The development version is on github at [http://github.com/doherty/utf8-all](http://github.com/doherty/utf8-all) and may be cloned from [git://github.com/doherty/utf8-all.git](git://github.com/doherty/utf8-all.git) # BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at [https://github.com/doherty/utf8-all/issues](https://github.com/doherty/utf8-all/issues). # AUTHORS - Michael Schwern - Mike Doherty # COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. utf8-all-0.011/META.json0000644000175000017500000000453612177207705013244 0ustar mikemike{ "abstract" : "turn on Unicode - all of it", "author" : [ "Michael Schwern ", "Mike Doherty " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300035, CPAN::Meta::Converter version 2.131560", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "utf8-all", "no_index" : { "directory" : [ "corpus", "inc", "examples" ] }, "prereqs" : { "build" : { "requires" : { "Module::Build" : "0.3601" } }, "configure" : { "requires" : { "Dist::CheckConflicts" : "0.02", "Module::Build" : "0.3601" } }, "develop" : { "conflicts" : { "autodie" : "2.11" }, "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "conflicts" : { "autodie" : "2.11" }, "requires" : { "Dist::CheckConflicts" : "0.02", "Encode" : "0", "Import::Into" : "0", "Symbol" : "0", "charnames" : "0", "feature" : "0", "open" : "0", "parent" : "0", "perl" : "5.010", "strict" : "0", "utf8" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Capture::Tiny" : "0", "PerlIO" : "0", "Test::Fatal" : "0", "Test::More" : "0.96", "Test::Warn" : "0", "autodie" : "0", "version" : "0.77" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/doherty/utf8-all/issues" }, "homepage" : "http://metacpan.org/release/utf8-all/", "repository" : { "type" : "git", "url" : "git://github.com/doherty/utf8-all.git", "web" : "https://github.com/doherty/utf8-all" } }, "version" : "0.011", "x_breaks" : { "autodie" : "2.11" } } utf8-all-0.011/Build.PL0000644000175000017500000000452012177207705013110 0ustar mikemike use strict; use warnings; use Module::Build 0.3601; check_conflicts(); my %module_build_args = ( "build_requires" => { "Module::Build" => "0.3601" }, "configure_requires" => { "Dist::CheckConflicts" => "0.02", "Module::Build" => "0.3601" }, "dist_abstract" => "turn on Unicode - all of it", "dist_author" => [ "Michael Schwern ", "Mike Doherty " ], "dist_name" => "utf8-all", "dist_version" => "0.011", "license" => "perl", "module_name" => "utf8::all", "recommends" => {}, "recursive_test_files" => 1, "requires" => { "Dist::CheckConflicts" => "0.02", "Encode" => 0, "Import::Into" => 0, "Symbol" => 0, "charnames" => 0, "feature" => 0, "open" => 0, "parent" => 0, "perl" => "5.010", "strict" => 0, "utf8" => 0, "warnings" => 0 }, "script_files" => [], "test_requires" => { "Capture::Tiny" => 0, "PerlIO" => 0, "Test::Fatal" => 0, "Test::More" => "0.96", "Test::Warn" => 0, "autodie" => 0, "version" => "0.77" } ); unless ( eval { Module::Build->VERSION(0.4004) } ) { my $tr = delete $module_build_args{test_requires}; my $br = $module_build_args{build_requires}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } my $build = Module::Build->new(%module_build_args); $build->create_build_script; sub check_conflicts { if ( eval { require 'lib/utf8/all/Conflicts.pm'; 1; } ) { if ( eval { utf8::all::Conflicts->check_conflicts; 1 } ) { return; } else { my $err = $@; $err =~ s/^/ /mg; warn "***\n$err***\n"; } } else { print <<'EOF'; *** Your toolchain doesn't support configure_requires, so Dist::CheckConflicts hasn't been installed yet. You should check for conflicting modules manually by examining the list of conflicts in utf8::all::Conflicts once the installation finishes. *** EOF } return if $ENV{AUTOMATED_TESTING} || $ENV{NONINTERACTIVE_TESTING}; # More or less copied from Module::Build return if $ENV{PERL_MM_USE_DEFAULT}; return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); sleep 4; } utf8-all-0.011/MANIFEST0000644000175000017500000000136212177207705012746 0ustar mikemikeBuild.PL Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README README.mkdn corpus/testfile corpus/みかちゃん dist.ini lib/utf8/all.pm lib/utf8/all/Conflicts.pm t/00-compile.t t/ARGV.t t/ARGV_twice.t t/FATAL_utf8.t t/autodie.t t/charnames.t t/fc.t t/lexical-again.t t/lexical.t t/open.t t/readdir.t t/unicode_eval.t t/unicode_strings.t t/utf8.t xt/author/critic.t xt/author/test-eol.t xt/release/cpan-changes.t xt/release/dist-manifest.t xt/release/distmeta.t xt/release/kwalitee.t xt/release/meta-json.t xt/release/minimum-version.t xt/release/mojibake.t xt/release/no-tabs.t xt/release/pod-coverage.t xt/release/pod-linkcheck.t xt/release/pod-syntax.t xt/release/synopsis.t xt/release/test-version.t xt/release/unused-vars.t utf8-all-0.011/META.yml0000644000175000017500000000204212177207705013062 0ustar mikemike--- abstract: 'turn on Unicode - all of it' author: - 'Michael Schwern ' - 'Mike Doherty ' build_requires: Capture::Tiny: 0 Module::Build: 0.3601 PerlIO: 0 Test::Fatal: 0 Test::More: 0.96 Test::Warn: 0 autodie: 0 version: 0.77 configure_requires: Dist::CheckConflicts: 0.02 Module::Build: 0.3601 conflicts: autodie: 2.11 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300035, CPAN::Meta::Converter version 2.131560' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: utf8-all no_index: directory: - corpus - inc - examples requires: Dist::CheckConflicts: 0.02 Encode: 0 Import::Into: 0 Symbol: 0 charnames: 0 feature: 0 open: 0 parent: 0 perl: 5.010 strict: 0 utf8: 0 warnings: 0 resources: bugtracker: https://github.com/doherty/utf8-all/issues homepage: http://metacpan.org/release/utf8-all/ repository: git://github.com/doherty/utf8-all.git version: 0.011 x_breaks: autodie: 2.11 utf8-all-0.011/dist.ini0000644000175000017500000000057112177207705013262 0ustar mikemikename = utf8-all author = Michael Schwern author = Mike Doherty license = Perl_5 copyright_holder = Michael Schwern ; he wrote it, not me copyright_year = 2009 [@Author::DOHERTY] has_version = 0 disable_tests = Test::Portability [Conflicts] autodie = 2.11 utf8-all-0.011/LICENSE0000644000175000017500000004376012177207705012632 0ustar mikemikeThis software is copyright (c) 2009 by Michael Schwern . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2009 by Michael Schwern . This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2009 by Michael Schwern . This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End utf8-all-0.011/Changes0000644000175000017500000000251312177207705013107 0ustar mikemikeRevision history for Perl module utf8-all 0.011 2013-08-03 * Only decode readdir entries if utf8::all is in effect [leont] * Support direct dirhandles in readdir [leont] 0.010 2013-02-02 * Don't depend on localizable error strings 0.009 2012-10-27 * Don't depend on filesystem ordering [leont, GH #14] 0.008 2012-10-24 * Enable unicode_strings (see perldoc feature) [GH #2] * Enable unicode_eval (see perldoc feature) [GH #2] * Enable fc (see perldoc fc) [GH #2] * Wrap CORE::readdir to provide UTF-8 filenames [GH #11] 0.007 2012-08-01 * Use version.pm for comparing versions in the test suite * Better detection of warnings in t/FATAL_utf8.t * Don't fail the test suite if autodie is too old 0.006 2012-07-29 * Be less strict with detecting fatal UTF-8 error in test suite [GH #12] 0.005 2012-07-29 * Use Import::Into instead of home-grown "solution" [GH #10] * Don't permit running with autodie < 2.12, due to RT #54777 [GH #7] * Promote utf8 warnings to fatal errors [GH #1] 0.004 2012-01-04 * Fix test suite for less current versions of Perl [getty, doherty] 0.003 2011-12-21 * Internal refactoring * Load charnames [sartak] 0.002 2011-04-21 * Expand test suite slightly 0.001 2011-04-20 * Split code out of perl5i utf8-all-0.011/README0000644000175000017500000000526212177207705012500 0ustar mikemikeNAME utf8::all - turn on Unicode - all of it VERSION version 0.011 SYNOPSIS use utf8::all; # Turn on UTF-8. All of it. open my $in, '<', 'contains-utf8'; # UTF-8 already turned on here print length 'føø bār'; # 7 UTF-8 characters my $utf8_arg = shift @ARGV; # @ARGV is UTF-8 too! DESCRIPTION utf8 allows you to write your Perl encoded in UTF-8. That means UTF-8 strings, variable names, and regular expressions. "utf8::all" goes further, and makes @ARGV encoded in UTF-8, and filehandles are opened with UTF-8 encoding turned on by default (including STDIN, STDOUT, STDERR), and charnames are imported so "\N{...}" sequences can be used to compile Unicode characters based on names. If you *don't* want UTF-8 for a particular filehandle, you'll have to set "binmode $filehandle". The pragma is lexically-scoped, so you can do the following if you had some reason to: { use utf8::all; open my $out, '>', 'outfile'; my $utf8_str = 'føø bār'; print length $utf8_str, "\n"; # 7 print $out $utf8_str; # out as utf8 } open my $in, '<', 'outfile'; # in as raw my $text = do { local $/; <$in>}; print length $text, "\n"; # 10, not 7! INTERACTION WITH AUTODIE If you use autodie, which is a great idea, you need to use at least version 2.12, released on June 26, 2012 . Otherwise, autodie obliterates the IO layers set by the open pragma. See RT #54777 and GH #7 . AVAILABILITY The project homepage is . The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit to find a CPAN site near you, or see . SOURCE The development version is on github at and may be cloned from BUGS AND LIMITATIONS You can make new bug reports, and view existing ones, through the web interface at . AUTHORS * Michael Schwern * Mike Doherty COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. utf8-all-0.011/t/0000775000175000017500000000000012177207705012060 5ustar mikemikeutf8-all-0.011/t/unicode_strings.t0000644000175000017500000000347412177207705015452 0ustar mikemike#!perl # utf8::all should turn on feature qw(unicode_strings) use strict; use warnings; use Test::More; plan $^V >= v5.14.0 ? (tests => 13) : (skip_all => q/character set modifiers aren't available until 5.14.0/); my $code = <<'TEST_CODE'; # Straight out of t/re/pat.t { # Test that charset modifier work, and are interpolated is(qr/\b\v$/, '(?^:\b\v$)', 'Verify no locale, no unicode_strings gives default modifier'); is(qr/(?l:\b\v$)/, '(?^:(?l:\b\v$))', 'Verify infix l modifier compiles'); is(qr/(?u:\b\v$)/, '(?^:(?u:\b\v$))', 'Verify infix u modifier compiles'); is(qr/(?l)\b\v$/, '(?^:(?l)\b\v$)', 'Verify (?l) compiles'); is(qr/(?u)\b\v$/, '(?^:(?u)\b\v$)', 'Verify (?u) compiles'); my $dual = qr/\b\v$/; use locale; my $locale = qr/\b\v$/; is($locale, '(?^l:\b\v$)', 'Verify has l modifier when compiled under use locale'); no locale; use utf8::all; # use utf8::all instead of feature qw(unicode_strings); my $unicode = qr/\b\v$/; is($unicode, '(?^u:\b\v$)', 'Verify has u modifier when compiled under unicode_strings'); is(qr/abc$dual/, '(?^u:abc(?^:\b\v$))', 'Verify retains d meaning when interpolated under locale'); is(qr/abc$locale/, '(?^u:abc(?^l:\b\v$))', 'Verify retains l when interpolated under unicode_strings'); no feature 'unicode_strings'; is(qr/abc$locale/, '(?^:abc(?^l:\b\v$))', 'Verify retains l when interpolated outside locale and unicode strings'); is(qr/def$unicode/, '(?^:def(?^u:\b\v$))', 'Verify retains u when interpolated outside locale and unicode strings'); use locale; is(qr/abc$dual/, '(?^l:abc(?^:\b\v$))', 'Verify retains d meaning when interpolated under locale'); is(qr/abc$unicode/, '(?^l:abc(?^u:\b\v$))', 'Verify retains u when interpolated under locale'); } TEST_CODE eval $code;utf8-all-0.011/t/lexical-again.t0000644000175000017500000000040112177207705014734 0ustar mikemike#!perl # utf8::all should have lexical effect use Test::More tests => 2; BEGIN { @ARGV = qw(føø bar bāz); } use utf8::all; is_deeply \@ARGV, [qw(føø bar bāz)]; { no utf8::all; is_deeply \@ARGV, ["f\x{f8}\x{f8}", 'bar', "b\x{101}z"]; } utf8-all-0.011/t/unicode_eval.t0000644000175000017500000000134112177207705014677 0ustar mikemike#!perl # utf8::all should turn on feature qw(unicode_strings) use strict; use warnings; use Test::More; plan $^V >= v5.16.0 ? (tests => 5) : (skip_all => q/Can't enable unicode_eval on perl < 5.16.0/); # straight out of t/uni/eval.t use utf8::all; { my $w; $SIG{__WARN__} = sub { $w = shift }; use utf8; my $prog = "qq!\x{f9}!"; eval $prog; ok !$w; $w = ""; utf8::upgrade($prog); eval $prog; is $w, ''; } { use utf8; isnt eval "q!\360\237\220\252!", eval "q!\x{1f42a}!"; } { no utf8; #Let's make real sure. my $not_utf8 = "q!\343\203\213!"; isnt eval $not_utf8, eval "q!\x{30cb}!"; { use utf8; isnt eval $not_utf8, eval "q!\x{30cb}!"; } }utf8-all-0.011/t/00-compile.t0000644000175000017500000000112712177207705014111 0ustar mikemikeuse strict; use warnings; # This test was generated via Dist::Zilla::Plugin::Test::Compile 2.011 use Test::More 0.88; use Capture::Tiny qw{ capture }; my @module_files = qw( lib/utf8/all.pm ); my @scripts = qw( ); # no fake home requested my @warnings; for my $lib (@module_files) { my ($stdout, $stderr, $exit) = capture { system($^X, '-Mblib', '-e', qq{require qq[$lib]}); }; is($?, 0, "$lib loaded ok"); warn $stderr if $stderr; push @warnings, $stderr if $stderr; } is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; done_testing; utf8-all-0.011/t/FATAL_utf8.t0000644000175000017500000000160112177207705014036 0ustar mikemikeuse strict; use warnings; use Test::More tests => 3; use Test::Warn; use warnings FATAL=>'utf8'; # Fatal warning warning_like { eval q/open my $out, '>', \my $mem; binmode $out, ':raw'; print $out "\x{FACE}"/; warn $@ } qr/Wide character/, # warning categories only work for non-fatal warnings 'Fatal "Wide character" warning' or diag $@; # Non-fatal warning warning_like { open my $out, '>', \my $mem; binmode $out, ':raw'; use warnings NONFATAL => 'utf8'; # downgrade to non-fatal utf8 warnings print $out "\x{FACE}" } 'utf8',#qr/Wide character/, 'Non-fatal "Wide character" warning' or diag $@; warning_is { open my $out, '>', \my $mem; binmode $out, ':raw'; no warnings FATAL => 'utf8'; # disable fatal utf8 warnings print $out "\x{FACE}"; } [], 'No "Wide character" warning';utf8-all-0.011/t/ARGV_twice.t0000644000175000017500000000036512177207705014201 0ustar mikemike#!perl # Test that utf8::all doesn't double encode @ARGV [perl5i github 176] BEGIN { @ARGV = qw(føø bar bāz); } { package Foo; use utf8::all; } use utf8::all; use Test::More tests => 1; is_deeply \@ARGV, [qw(føø bar bāz)]; utf8-all-0.011/t/charnames.t0000644000175000017500000000057112177207705014207 0ustar mikemike#!perl # Test that utf8::all imports charnames for \N use utf8::all; use Test::More tests => 3; is_deeply "\N{GREEK SMALL LETTER SIGMA} is called sigma.", "σ is called sigma.", ':full'; is_deeply "\N{greek:Sigma}", "Σ", ':short'; is_deeply charnames::vianame("GOTHIC LETTER AHSA"), 66352, 'charnames::vianame'; utf8-all-0.011/t/lexical.t0000644000175000017500000000060312177207705013663 0ustar mikemike#!perl # utf8::all should have lexical effect use Test::More tests => 2; BEGIN { @ARGV = qw(føø bar bāz); } # use utf8::all in a narrow lexical scope. # It shouldn't effect the rest of the program. { use utf8::all } is_deeply \@ARGV, ["f\x{f8}\x{f8}", 'bar', "b\x{101}z"]; { # Bring utf8::all back into effect use utf8::all; is_deeply \@ARGV, [qw(føø bar bāz)]; } utf8-all-0.011/t/readdir.t0000644000175000017500000000277712177207705013672 0ustar mikemikeuse strict; use warnings; use Test::More 0.96 tests => 3; use Encode qw/decode FB_CROAK/; subtest utf8 => sub { plan tests => 3; opendir my $dh, 'corpus' or die "Couldn't open directory 'corpus'"; my @files = sort grep { $_ ne '.' and $_ ne '..' } readdir $dh; my @utf8_files; { rewinddir $dh; use utf8::all; @utf8_files = sort grep { $_ ne '.' and $_ ne '..' } readdir $dh; } closedir $dh; is_deeply \@utf8_files, [sort "\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}", "testfile"]; is $files[0] => $utf8_files[0]; isnt $files[1] => $utf8_files[1]; }; subtest context => sub { plan tests => 1; opendir my $dh, 'corpus' or die "Couldn't open directory 'corpus'"; use utf8::all; my $core = CORE::readdir $dh; rewinddir $dh; my $utf8 = readdir $dh; rewinddir $dh; is $utf8 => decode('UTF-8', $core, FB_CROAK) or diag "$utf8 : $core"; closedir $dh; }; subtest package_var => sub { plan tests => 3; opendir DH, 'corpus' or die "Couldn't open directory 'corpus'"; my @files = sort grep { $_ ne '.' and $_ ne '..' } eval { readdir DH; }; my @utf8_files; { rewinddir DH; use utf8::all; @utf8_files = sort grep { $_ ne '.' and $_ ne '..' } readdir DH; } closedir DH; is_deeply \@utf8_files, [sort "\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}", "testfile"]; is $files[0] => $utf8_files[0]; is decode('UTF-8', $files[1], FB_CROAK) => $utf8_files[1]; }; utf8-all-0.011/t/autodie.t0000644000175000017500000000223712177207705013701 0ustar mikemikeuse strict; use warnings; use version 0.77; use Test::More 0.96; use Test::Fatal; if ( eval { require autodie; 1 } ) { plan skip_all => "autodie is version $autodie::VERSION, but must be greater than version 2.11" if (version->parse($autodie::VERSION) < version->parse(2.11)); plan tests => 2; } else { plan skip_all => "autodie is required for these tests"; } no autodie; subtest 'autodie first' => sub { plan tests => 2; use autodie; use utf8::all; opendir my $dh, 'corpus'; my @files = sort grep { !m{^\.} } readdir $dh; closedir $dh; is_deeply \@files, [sort "\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}", "testfile"]; my $exception = exception { opendir my $no_dh, 'nonexistent' }; like $exception => qr/^\QCan't opendir/; }; subtest 'autodie last' => sub { plan tests => 2; use utf8::all; use autodie; opendir my $dh, 'corpus'; my @files = sort grep { !m{^\.} } readdir $dh; closedir $dh; is_deeply \@files, [ sort "\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}", "testfile"]; my $exception = exception { opendir my $no_dh, 'nonexistent' }; like $exception, qr/^\QCan't opendir/; }; utf8-all-0.011/t/ARGV.t0000644000175000017500000000025512177207705013004 0ustar mikemike#!perl # Test that utf8::all makes @ARGV utf8 BEGIN { @ARGV = qw(føø bar bāz); } use utf8::all; use Test::More tests => 1; is_deeply \@ARGV, [qw(føø bar bāz)]; utf8-all-0.011/t/utf8.t0000644000175000017500000000214412177207705013132 0ustar mikemike#!perl # utf8::all turns on utf8 use strict; use warnings; use PerlIO; use Test::More; # Test with it on { use utf8::all; is length "utf8::all is MËTÁŁ", 18; # Test the standard handles and all newly opened handles are utf8 ok open my $test_fh, ">", "perlio_test"; END { unlink "perlio_test" } for my $fh (*STDOUT, *STDIN, *STDERR, $test_fh) { my @layers = PerlIO::get_layers($fh); ok(grep(m/utf8/, @layers), 'utf8 appears in the perlio layers') or diag explain { $test_fh => \@layers }; ok(grep(m/utf-8-strict/, @layers), 'utf-8-strict appears in the perlio layers') or diag explain { $test_fh => \@layers }; } } # And off { ok open my $test_fh, ">", "perlio_test2"; END { unlink "perlio_test2" } my @layers = PerlIO::get_layers($test_fh); ok( !grep(/utf8/, @layers), q{utf8 doesn't appear in perlio layers}) or diag explain { $test_fh => \@layers }; ok( !grep(m/utf-8-strict/, @layers), q{utf-8-strict doesn't appear in the perlio layers}) or diag explain { $test_fh => \@layers }; } done_testing; utf8-all-0.011/t/open.t0000644000175000017500000000075412177207705013212 0ustar mikemike#!perl # Test opening an actual file use utf8::all; use PerlIO; use Test::More tests => 4; ok open my $in, '<', 'corpus/testfile'; my @layers = PerlIO::get_layers($in); ok(grep(m/utf8/, @layers), 'utf8 appears in the perlio layers') or diag explain { $fh => \@layers }; ok(grep(m/utf-8-strict/, @layers), 'utf-8-strict appears in the perlio layers') or diag explain { $fh => \@layers }; my $contents = do { local $/; <$in>}; is $contents, "f\x{f8}\x{f8}\n", 'unicode retrieved OK'; utf8-all-0.011/t/fc.t0000644000175000017500000000077012177207705012637 0ustar mikemike#!perl # utf8::all should turn on feature qw(unicode_strings) use strict; use warnings; use Test::More; plan $^V >= v5.16.0 ? (tests => 3) : (skip_all => q/Can't enable fc on perl < 5.16.0/); { no warnings qw(syntax); eval q/fc 'ABC' eq fc 'abc';/; ok $@, 'Got an error using fc without utf8::all...'; like $@ => qr/^syntax error/, '...and the error was a syntax error' or diag $@; } eval q/ use utf8::all; fc 'XYZ' eq fc 'xyz'; /; ok !$@, 'no error with utf8::all' or diag $@;