utf8-all-0.024/000755 000766 000024 00000000000 13223632574 013266 5ustar00hayostaff000000 000000 utf8-all-0.024/appveyor.yml000644 000766 000024 00000000611 13223632574 015654 0ustar00hayostaff000000 000000 branches: except: - /travis/ skip_tags: true cache: - C:\strawberry -> appveyor.yml install: - if not exist "C:\strawberry" cinst strawberryperl - set PATH=C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH% - cd C:\projects\%APPVEYOR_PROJECT_NAME% - cpanm --installdeps . build_script: - perl Makefile.PL - dmake test_script: - dmake test utf8-all-0.024/Changes000644 000766 000024 00000011401 13223632574 014556 0ustar00hayostaff000000 000000 Revision history for Perl module utf8-all 0.024 2018-01-05 * Adapted force_global test to work when the perl unicode flag is active [gh-48; HayoBaan] 0.023 2017-05-29 * Global effects (e.g. adding UTF-8 to STD* layers) now only enabled when utf8::all is used from the main package. Options exist to override this default behaviour [gh-47; HayoBaan] 0.022 2017-04-22 * Adpated to changes in Encode v2.89 [HayoBaan] 0.021 2016-08-16 * Fixed: Not encoding readdir DIRHANDLE argument [gh-35; HayoBaan] * Fixed: Enforcing LEAVE_SRC on $utf8::all::UTF_CHECK [HayoBaan] * Skipping thread test on Perl<=v5.10.0 (threads unstable there) [HayoBaan] 0.020 2016-08-11 * Always using PerlIO::utf8_strict as I/O conversion [gh-44; schwern] * Fixed "UTF-16 surrogate 0xd800" error in some builds [HayoBaan] 0.019 2016-08-10 * Removed Build.PL, require >= v0.009 of PluginBundle [HayoBaan] 0.018 2016-08-10 * Now choosing a utf-8 encoding that will not break threads [gh-43; schwern] * Handling utf-8 encoding/decoding errors [gh-35; HayoBaan] * New maintainer: [HayoBaan] 0.017 2015-11-13 * Tests now correctly handle the PERL_UNICODE env variable [gh-40; HayoBaan] and the -C perl command-line flag. * Implemented "no utf8::all" [gh-33; HayoBaan] * Corrected a number of tests [HayoBaan] * Added wrapper for readlink [gh-21; HayoBaan] * Added test for readpipe, qx, and backtick operator [HayoBaan] * Rewrote documentation [HayoBaan] 0.016 2015-01-08 * Not decoding @ARGV when perl is run with -CA [gh-32; HayoBaan] Thank you [saulery] for the tip! * Fixed exclusion of Windows platform [HayoBaan] * Excluding DOS and OS/2 platforms [HayoBaan] * Moved utf-8 aware implementation of File::Find and Cwd to [gh-40; HayoBaan] their own module (File::Find::utf8 and Cwd::utf8) 0.015 2014-08-28 * Fixed changelog for 0.014 * Removed overly optimistic use of v5.20.0 syntax 0.014 2014-08-27 * Skip locale tests on systems without locale support [gh-27; Hugmeir] * Added wrapper for: [HayoBaan] - glob [HayoBaan] - File::Find::find, File::Find::finddepth, [HayoBaan] - Cwd::cwd Cwd::fastcwd Cwd::getcwd Cwd::fastgetcwd [HayoBaan] - Cwd::abs_path Cwd::realpath Cwd::fast_abs_path [HayoBaan] 0.013 2014-08-19 * Warn instead of bailing out of the test suite when autodie [gh-26, gh-22] is old * Only decoding @ARGV when called from the main package [gh-18; HayoBaan] 0.012 2014-08-03 * Disable wrapping readdir on Windows [gh-17] * Don't ship files with names that aren't portable to Windows [gh-17] 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.024/corpus/000755 000766 000024 00000000000 13223632574 014601 5ustar00hayostaff000000 000000 utf8-all-0.024/dist.ini000644 000766 000024 00000000654 13223632574 014737 0ustar00hayostaff000000 000000 name = utf8-all author = Michael Schwern author = Mike Doherty author = Hayo Baan license = Perl_5 copyright_holder = Michael Schwern ; he originated it copyright_year = 2009 [@Author::HAYOBAAN] :version = 0.009 is_cpan = 1 max_target_perl = 5.010 utf8-all-0.024/INSTALL000644 000766 000024 00000002150 13223632574 014315 0ustar00hayostaff000000 000000 This is the Perl distribution utf8-all. Installing utf8-all is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm utf8::all If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan utf8::all ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib ## Documentation utf8-all documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc utf8::all utf8-all-0.024/lib/000755 000766 000024 00000000000 13223632574 014034 5ustar00hayostaff000000 000000 utf8-all-0.024/LICENSE000644 000766 000024 00000044050 13223632574 014276 0ustar00hayostaff000000 000000 This software is copyright (c) 2009 by Michael Schwern ; he originated it. 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 ; he originated it. 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, Fifth Floor, Boston, MA 02110-1301 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 ; he originated it. 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.024/Makefile.PL000644 000766 000024 00000004062 13223632574 015242 0ustar00hayostaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.006. use strict; use warnings; use 5.010; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "turn on Unicode - all of it", "AUTHOR" => "Michael Schwern , Mike Doherty , Hayo Baan ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "utf8-all", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.010", "NAME" => "utf8::all", "PREREQ_PM" => { "Carp" => 0, "Encode" => 0, "Import::Into" => 0, "PerlIO::utf8_strict" => 0, "Symbol" => 0, "charnames" => 0, "feature" => 0, "open" => 0, "parent" => 0, "strict" => 0, "utf8" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "PerlIO" => 0, "Test::Exception" => 0, "Test::Fatal" => 0, "Test::More" => "0.96", "Test::Warn" => 0, "autodie" => 0, "blib" => "1.01", "constant" => 0, "threads" => 0, "threads::shared" => 0, "version" => "0.77" }, "VERSION" => "0.024", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Encode" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Import::Into" => 0, "PerlIO" => 0, "PerlIO::utf8_strict" => 0, "Symbol" => 0, "Test::Exception" => 0, "Test::Fatal" => 0, "Test::More" => "0.96", "Test::Warn" => 0, "autodie" => 0, "blib" => "1.01", "charnames" => 0, "constant" => 0, "feature" => 0, "open" => 0, "parent" => 0, "strict" => 0, "threads" => 0, "threads::shared" => 0, "utf8" => 0, "version" => "0.77", "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); utf8-all-0.024/MANIFEST000644 000766 000024 00000001654 13223632574 014425 0ustar00hayostaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.006. Changes INSTALL LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README README.mkdn appveyor.yml corpus/testfile dist.ini lib/utf8/all.pm t/00-compile.t t/ARGV.t t/ARGV_nonmain.t t/ARGV_twice.t t/FATAL_utf8.t t/autodie.t t/charnames.t t/fc.t t/force_global.t t/glob.t t/global_nonmain.t t/lexical-again.t t/lexical.t t/no_global.t t/open.t t/readdir.t t/readlink.t t/readpipe.t t/threads.t t/unicode_eval.t t/unicode_strings.t t/utf8.t t/utf8_check.t xt/author/critic.t xt/author/eol.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-syntax.t xt/author/portability.t xt/author/synopsis.t xt/author/test-version.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/pod-linkcheck.t xt/release/unused-vars.t utf8-all-0.024/MANIFEST.SKIP000644 000766 000024 00000001470 13223632574 015166 0ustar00hayostaff000000 000000 # 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.024/META.json000644 000766 000024 00000005666 13223632574 014724 0ustar00hayostaff000000 000000 { "abstract" : "turn on Unicode - all of it", "author" : [ "Michael Schwern ", "Mike Doherty ", "Hayo Baan " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.006, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "utf8-all", "no_index" : { "directory" : [ "corpus" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.010" } }, "develop" : { "requires" : { "English" : "0", "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CPAN::Meta::JSON" : "0.16", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::LinkCheck" : "0", "Test::Portability::Files" : "0", "Test::Synopsis" : "0", "Test::Vars" : "0", "Test::Version" : "1" } }, "runtime" : { "requires" : { "Carp" : "0", "Encode" : "0", "Import::Into" : "0", "PerlIO::utf8_strict" : "0", "Symbol" : "0", "charnames" : "0", "feature" : "0", "open" : "0", "parent" : "0", "perl" : "5.010", "strict" : "0", "utf8" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "PerlIO" : "0", "Test::Exception" : "0", "Test::Fatal" : "0", "Test::More" : "0.96", "Test::Warn" : "0", "autodie" : "0", "blib" : "1.01", "constant" : "0", "perl" : "5.010", "threads" : "0", "threads::shared" : "0", "version" : "0.77" } } }, "provides" : { "utf8::all" : { "file" : "lib/utf8/all.pm", "version" : "0.024" } }, "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.024", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0217" } utf8-all-0.024/META.yml000644 000766 000024 00000002413 13223632574 014537 0ustar00hayostaff000000 000000 --- abstract: 'turn on Unicode - all of it' author: - 'Michael Schwern ' - 'Mike Doherty ' - 'Hayo Baan ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' PerlIO: '0' Test::Exception: '0' Test::Fatal: '0' Test::More: '0.96' Test::Warn: '0' autodie: '0' blib: '1.01' constant: '0' perl: '5.010' threads: '0' threads::shared: '0' version: '0.77' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.010' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.006, CPAN::Meta::Converter version 2.150005' 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 provides: utf8::all: file: lib/utf8/all.pm version: '0.024' requires: Carp: '0' Encode: '0' Import::Into: '0' PerlIO::utf8_strict: '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.024' x_serialization_backend: 'YAML::Tiny version 1.69' utf8-all-0.024/README000644 000766 000024 00000012576 13223632574 014161 0ustar00hayostaff000000 000000 NAME utf8::all - turn on Unicode - all of it VERSION version 0.024 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 (only for main) DESCRIPTION The use utf8 pragma tells the Perl parser to allow UTF-8 in the program text in the current lexical scope. This also means that you can now use literal Unicode characters as part of strings, variable names, and regular expressions. utf8::all goes further: * charnames are imported so \N{...} sequences can be used to compile Unicode characters based on names. * On Perl v5.11.0 or higher, the use feature 'unicode_strings' is enabled. * use feature fc and use feature unicode_eval are enabled on Perl 5.16.0 and higher. * Filehandles are opened with UTF-8 encoding turned on by default (including STDIN, STDOUT, and STDERR when utf8::all is used from the main package). Meaning that they automatically convert UTF-8 octets to characters and vice versa. If you don't want UTF-8 for a particular filehandle, you'll have to set binmode $filehandle. * @ARGV gets converted from UTF-8 octets to Unicode characters (when utf8::all is used from the main package). This is similar to the behaviour of the -CA perl command-line switch (see perlrun). * readdir, readlink, readpipe (including the qx// and backtick operators), and glob (including the <> operator) now all work with and return Unicode characters instead of (UTF-8) octets (again only when utf8::all is used from the main package). Lexical Scope 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! Instead of lexical scoping, you can also use no utf8::all to turn off the effects. Note that the effect on @ARGV and the STDIN, STDOUT, and STDERR file handles is always global and can not be undone! Enabling/Disabling Global Features As described above, the default behaviour of utf8::all is to convert @ARGV and to open the STDIN, STDOUT, and STDERR file handles with UTF-8 encoding, and override the readlink and readdir functions and glob operators when utf8::all is used from the main package. If you want to disable these features even when utf8::all is used from the main package, add the option NO-GLOBAL (or LEXICAL-ONLY) to the use line. E.g.: use utf8::all 'NO-GLOBAL'; If on the other hand you want to enable these global effects even when utf8::all was used from another package than main, use the option GLOBAL on the use line: use utf8::all 'GLOBAL'; UTF-8 Errors utf8::all will handle invalid code points (i.e., utf-8 that does not map to a valid unicode "character"), as a fatal error. For glob, readdir, and readlink, one can change this behaviour by setting the attribute "$utf8::all::UTF8_CHECK". ATTRIBUTES $utf8::all::UTF8_CHECK By default utf8::all marks decoding errors as fatal (default value for this setting is Encode::FB_CROAK). If you want, you can change this by setting $utf8::all::UTF8_CHECK. The value Encode::FB_WARN reports the encoding errors as warnings, and Encode::FB_DEFAULT will completely ignore them. Please see Encode for details. Note: Encode::LEAVE_SRC is always enforced. Important: Only controls the handling of decoding errors in glob, readdir, and readlink. 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 . BUGS Please report any bugs or feature requests on the bugtracker website . When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. COMPATIBILITY The filesystems of Dos, Windows, and OS/2 do not (fully) support UTF-8. The readlink and readdir functions and glob operators will therefore not be replaced on these systems. SEE ALSO * File::Find::utf8 for fully utf-8 aware File::Find functions. * Cwd::utf8 for fully utf-8 aware Cwd functions. AUTHORS * Michael Schwern * Mike Doherty * Hayo Baan COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern ; he originated it. 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.024/README.mkdn000644 000766 000024 00000012716 13223632574 015105 0ustar00hayostaff000000 000000 # NAME utf8::all - turn on Unicode - all of it # VERSION version 0.024 # 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 (only for main) # DESCRIPTION The `use utf8` pragma tells the Perl parser to allow UTF-8 in the program text in the current lexical scope. This also means that you can now use literal Unicode characters as part of strings, variable names, and regular expressions. `utf8::all` goes further: - [`charnames`](https://metacpan.org/pod/charnames) are imported so `\N{...}` sequences can be used to compile Unicode characters based on names. - On Perl `v5.11.0` or higher, the `use feature 'unicode_strings'` is enabled. - `use feature fc` and `use feature unicode_eval` are enabled on Perl `5.16.0` and higher. - Filehandles are opened with UTF-8 encoding turned on by default (including `STDIN`, `STDOUT`, and `STDERR` when `utf8::all` is used from the `main` package). Meaning that they automatically convert UTF-8 octets to characters and vice versa. If you _don't_ want UTF-8 for a particular filehandle, you'll have to set `binmode $filehandle`. - `@ARGV` gets converted from UTF-8 octets to Unicode characters (when `utf8::all` is used from the `main` package). This is similar to the behaviour of the `-CA` perl command-line switch (see [perlrun](https://metacpan.org/pod/perlrun)). - `readdir`, `readlink`, `readpipe` (including the `qx//` and backtick operators), and [`glob`](https://metacpan.org/pod/perlfunc#glob) (including the `<>` operator) now all work with and return Unicode characters instead of (UTF-8) octets (again only when `utf8::all` is used from the `main` package). ## Lexical Scope 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! Instead of lexical scoping, you can also use `no utf8::all` to turn off the effects. Note that the effect on `@ARGV` and the `STDIN`, `STDOUT`, and `STDERR` file handles is always global and can not be undone! ## Enabling/Disabling Global Features As described above, the default behaviour of `utf8::all` is to convert `@ARGV` and to open the `STDIN`, `STDOUT`, and `STDERR` file handles with UTF-8 encoding, and override the `readlink` and `readdir` functions and `glob` operators when `utf8::all` is used from the `main` package. If you want to disable these features even when `utf8::all` is used from the `main` package, add the option `NO-GLOBAL` (or `LEXICAL-ONLY`) to the use line. E.g.: use utf8::all 'NO-GLOBAL'; If on the other hand you want to enable these global effects even when `utf8::all` was used from another package than `main`, use the option `GLOBAL` on the use line: use utf8::all 'GLOBAL'; ## UTF-8 Errors `utf8::all` will handle invalid code points (i.e., utf-8 that does not map to a valid unicode "character"), as a fatal error. For `glob`, `readdir`, and `readlink`, one can change this behaviour by setting the attribute ["$utf8::all::UTF8\_CHECK"](#utf8-all-utf8_check). # ATTRIBUTES ## $utf8::all::UTF8\_CHECK By default `utf8::all` marks decoding errors as fatal (default value for this setting is `Encode::FB_CROAK`). If you want, you can change this by setting `$utf8::all::UTF8_CHECK`. The value `Encode::FB_WARN` reports the encoding errors as warnings, and `Encode::FB_DEFAULT` will completely ignore them. Please see [Encode](https://metacpan.org/pod/Encode) for details. Note: `Encode::LEAVE_SRC` is _always_ enforced. Important: Only controls the handling of decoding errors in `glob`, `readdir`, and `readlink`. # INTERACTION WITH AUTODIE If you use [autodie](https://metacpan.org/pod/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](https://metacpan.org/pod/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). # BUGS Please report any bugs or feature requests on the bugtracker [website](https://github.com/doherty/utf8-all/issues). When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. # COMPATIBILITY The filesystems of Dos, Windows, and OS/2 do not (fully) support UTF-8. The `readlink` and `readdir` functions and `glob` operators will therefore not be replaced on these systems. # SEE ALSO - [File::Find::utf8](https://metacpan.org/pod/File::Find::utf8) for fully utf-8 aware File::Find functions. - [Cwd::utf8](https://metacpan.org/pod/Cwd::utf8) for fully utf-8 aware Cwd functions. # AUTHORS - Michael Schwern - Mike Doherty - Hayo Baan # COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern ; he originated it. 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.024/t/000755 000766 000024 00000000000 13223632574 013531 5ustar00hayostaff000000 000000 utf8-all-0.024/xt/000755 000766 000024 00000000000 13223632574 013721 5ustar00hayostaff000000 000000 utf8-all-0.024/xt/author/000755 000766 000024 00000000000 13223632574 015223 5ustar00hayostaff000000 000000 utf8-all-0.024/xt/release/000755 000766 000024 00000000000 13223632574 015341 5ustar00hayostaff000000 000000 utf8-all-0.024/xt/release/cpan-changes.t000644 000766 000024 00000000344 13223632574 020056 0ustar00hayostaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; utf8-all-0.024/xt/release/dist-manifest.t000644 000766 000024 00000000230 13223632574 020270 0ustar00hayostaff000000 000000 #!perl use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); utf8-all-0.024/xt/release/distmeta.t000644 000766 000024 00000000172 13223632574 017340 0ustar00hayostaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); utf8-all-0.024/xt/release/kwalitee.t000644 000766 000024 00000000275 13223632574 017337 0ustar00hayostaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; utf8-all-0.024/xt/release/meta-json.t000644 000766 000024 00000000064 13223632574 017423 0ustar00hayostaff000000 000000 #!perl use Test::CPAN::Meta::JSON; meta_json_ok(); utf8-all-0.024/xt/release/minimum-version.t000644 000766 000024 00000000266 13223632574 020670 0ustar00hayostaff000000 000000 #!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.010} ); utf8-all-0.024/xt/release/pod-linkcheck.t000644 000766 000024 00000000537 13223632574 020246 0ustar00hayostaff000000 000000 #!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.024/xt/release/unused-vars.t000644 000766 000024 00000000362 13223632574 020003 0ustar00hayostaff000000 000000 #!perl use Test::More 0.96 tests => 1; eval { require Test::Vars }; SKIP: { skip 1 => 'Test::Vars required for testing for unused vars' if $@; Test::Vars->import; subtest 'unused vars' => sub { all_vars_ok(); }; }; utf8-all-0.024/xt/author/critic.t000644 000766 000024 00000000435 13223632574 016667 0ustar00hayostaff000000 000000 #!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.024/xt/author/eol.t000644 000766 000024 00000001322 13223632574 016165 0ustar00hayostaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/utf8/all.pm', 't/00-compile.t', 't/ARGV.t', 't/ARGV_nonmain.t', 't/ARGV_twice.t', 't/FATAL_utf8.t', 't/autodie.t', 't/charnames.t', 't/fc.t', 't/force_global.t', 't/glob.t', 't/global_nonmain.t', 't/lexical-again.t', 't/lexical.t', 't/no_global.t', 't/open.t', 't/readdir.t', 't/readlink.t', 't/readpipe.t', 't/threads.t', 't/unicode_eval.t', 't/unicode_strings.t', 't/utf8.t', 't/utf8_check.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; utf8-all-0.024/xt/author/mojibake.t000644 000766 000024 00000000151 13223632574 017166 0ustar00hayostaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); utf8-all-0.024/xt/author/no-tabs.t000644 000766 000024 00000001270 13223632574 016753 0ustar00hayostaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/utf8/all.pm', 't/00-compile.t', 't/ARGV.t', 't/ARGV_nonmain.t', 't/ARGV_twice.t', 't/FATAL_utf8.t', 't/autodie.t', 't/charnames.t', 't/fc.t', 't/force_global.t', 't/glob.t', 't/global_nonmain.t', 't/lexical-again.t', 't/lexical.t', 't/no_global.t', 't/open.t', 't/readdir.t', 't/readlink.t', 't/readpipe.t', 't/threads.t', 't/unicode_eval.t', 't/unicode_strings.t', 't/utf8.t', 't/utf8_check.t' ); notabs_ok($_) foreach @files; done_testing; utf8-all-0.024/xt/author/pod-coverage.t000644 000766 000024 00000000334 13223632574 017763 0ustar00hayostaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); utf8-all-0.024/xt/author/pod-syntax.t000644 000766 000024 00000000252 13223632574 017515 0ustar00hayostaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); utf8-all-0.024/xt/author/portability.t000644 000766 000024 00000000277 13223632574 017760 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); utf8-all-0.024/xt/author/synopsis.t000644 000766 000024 00000000060 13223632574 017273 0ustar00hayostaff000000 000000 #!perl use Test::Synopsis; all_synopsis_ok(); utf8-all-0.024/xt/author/test-version.t000644 000766 000024 00000000637 13223632574 020060 0ustar00hayostaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 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.024/t/00-compile.t000644 000766 000024 00000002325 13223632574 015565 0ustar00hayostaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'utf8/all.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; utf8-all-0.024/t/ARGV.t000644 000766 000024 00000001330 13223632574 014452 0ustar00hayostaff000000 000000 #!perl # Test that utf8::all makes @ARGV utf8 BEGIN { # String literals are still utf-8 encoded octets here! @ARGV = qw(føø bar bāz テスト); if (${^UNICODE} & 32) { # If we run with the Perl Unicode flag to automatically # convert the command-line arguments to unicode characters, # we need to do so here too! require Encode; $_ = Encode::decode('UTF-8' ,$_) for @ARGV; } } use utf8::all; use Test::More tests => 1; # føø bar bāz テスト but now as unicode characters is_deeply \@ARGV => [ "\x{66}\x{f8}\x{f8}", "\x{62}\x{61}\x{72}", "\x{62}\x{101}\x{7a}", "\x{30c6}\x{30b9}\x{30c8}" ], '@ARGV as unicode characters instead of utf-8 octets'; utf8-all-0.024/t/ARGV_nonmain.t000644 000766 000024 00000001056 13223632574 016176 0ustar00hayostaff000000 000000 #!perl # Test that utf8::all makes @ARGV utf8 (but not when not loaded from main) BEGIN { # String literals are still utf-8 encoded octets here! @ARGV = qw(føø bar bāz テスト); } package not_main; use utf8::all; use Test::More tests => 1; is_deeply \@ARGV => [ # føø bar bāz テスト still as utf-8 encoded octets "\x{66}\x{c3}\x{b8}\x{c3}\x{b8}", "\x{62}\x{61}\x{72}", "\x{62}\x{c4}\x{81}\x{7a}", "\x{e3}\x{83}\x{86}\x{e3}\x{82}\x{b9}\x{e3}\x{83}\x{88}", ], 'non main package: @ARGV still as utf-8 encoded octets'; utf8-all-0.024/t/ARGV_twice.t000644 000766 000024 00000001475 13223632574 015657 0ustar00hayostaff000000 000000 #!perl # Test that utf8::all doesn't double encode @ARGV [perl5i github 176] BEGIN { # String literals are still utf-8 encoded octets here! @ARGV = qw(føø bar bāz テスト); if (${^UNICODE} & 32) { # If we run with the Perl Unicode flag to automatically # convert the command-line arguments to unicode characters, # we need to do so here too! require Encode; $_ = Encode::decode('UTF-8' ,$_) for @ARGV; } } { package Foo; use utf8::all; } { use utf8::all; } use utf8::all; use Test::More tests => 1; # føø bar bāz テスト still intact as unicode characters is_deeply \@ARGV => [ "\x{66}\x{f8}\x{f8}", "\x{62}\x{61}\x{72}", "\x{62}\x{101}\x{7a}", "\x{30c6}\x{30b9}\x{30c8}" ], '@ARGV as unicode characters instead of utf-8 octets'; utf8-all-0.024/t/autodie.t000644 000766 000024 00000003160 13223632574 015350 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use version 0.77; use Test::More 0.96; use Test::Fatal; plan skip_all => "$^O does not have proper utf-8 file system support" if $^O =~ /MSWin32|cygwin|dos|os2/; mkdir "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}" or die "Couldn't create directory corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}: $!" unless -d "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}"; if ( eval { require autodie; 1 } ) { diag <parse($autodie::VERSION) <= version->parse(2.11); plan tests => 2; } else { plan skip_all => "autodie is required for these tests (but is not a prerequisite)"; } 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.024/t/charnames.t000644 000766 000024 00000000571 13223632574 015662 0ustar00hayostaff000000 000000 #!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.024/t/FATAL_utf8.t000644 000766 000024 00000001456 13223632574 015521 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 3; use Test::Warn; use utf8::all; # Fatal warning warning_like { eval q/open my $out, '>', \my $mem; binmode $out, ':raw'; print $out "\x{FACE}"/; warn $@ } qr/Wide character/, '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', '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.024/t/fc.t000644 000766 000024 00000000770 13223632574 014312 0ustar00hayostaff000000 000000 #!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 $@;utf8-all-0.024/t/force_global.t000644 000766 000024 00000002354 13223632574 016340 0ustar00hayostaff000000 000000 #!perl # Test that ust8::all with GLOBAL does change @ARGV, STDIN, STDOUT, STDERR use strict; use warnings; BEGIN { # String literals are still utf-8 encoded octets here! @ARGV = qw(føø bar bāz テスト); } package not_main; use utf8::all 'GLOBAL'; use PerlIO; use Test::More; SKIP: { # If we run with the Perl Unicode flag to automatically # convert the command-line arguments to unicode characters, # we need to skip this test skip 'Perl Unicode flag set to automatically convert command-line arguments', 1 if (${^UNICODE} & 32); # føø bar bāz テスト but now as unicode characters is_deeply \@ARGV => [ "\x{66}\x{f8}\x{f8}", "\x{62}\x{61}\x{72}", "\x{62}\x{101}\x{7a}", "\x{30c6}\x{30b9}\x{30c8}" ], '@ARGV as unicode characters instead of utf-8 octets'; } # Test the standard handles are utf-8 my $utf8_flag = 1; for my $fh (*STDIN, *STDOUT, *STDERR) { my @layers = PerlIO::get_layers($fh); 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 }; } done_testing; utf8-all-0.024/t/glob.t000644 000766 000024 00000002566 13223632574 014652 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96; use Encode qw/decode FB_CROAK/; plan skip_all => "$^O does not have proper utf-8 file system support" if $^O =~ /MSWin32|cygwin|dos|os2/; mkdir "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}" or die "Couldn't create directory corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}: $!" unless -d "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}"; plan tests => 1; subtest glob => sub { plan tests => 14; my @globs = (glob("corpus/*"), glob("corpus/{testfile,\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}}"), ); my $count = 0; while (my $glob = glob("corpus/*")) { push(@globs, $glob); $count++; } @globs = sort @globs; my @utf8_globs; my $utf8_count = 0; { use utf8::all; @utf8_globs = (glob("corpus/*"), glob("corpus/{testfile,\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}}"), ); while (my $glob = glob("corpus/*")) { push(@utf8_globs, $glob); $utf8_count++; } } @utf8_globs = sort @utf8_globs; is $count => 2, "glob: scalar version"; is $utf8_count => 2, "utf8_glob: scalar version"; for (my $i=0; $i<4; $i++) { is $globs[$i] => $utf8_globs[$i]; isnt $globs[4+$i] => $utf8_globs[4+$i]; is decode('UTF-8', $globs[4+$i], FB_CROAK) => $utf8_globs[4+$i]; } }; utf8-all-0.024/t/global_nonmain.t000644 000766 000024 00000003643 13223632574 016703 0ustar00hayostaff000000 000000 #!perl # Test that ust8::all from non-main package does not change @ARGV, STDIN, STDOUT, STDERR use strict; use warnings; BEGIN { # String literals are still utf-8 encoded octets here! @ARGV = qw(føø bar bāz テスト); } package not_main; use utf8::all; use PerlIO; use Test::More; SKIP: { # If we run with the Perl Unicode flag to automatically # convert the command-line arguments to unicode characters, # we need to skip this test skip 'Perl Unicode flag set to automatically convert command-line arguments', 1 if (${^UNICODE} & 32); # føø bar bāz テスト still as utf-8 encoded octets is_deeply \@ARGV => [ "\x{66}\x{c3}\x{b8}\x{c3}\x{b8}", "\x{62}\x{61}\x{72}", "\x{62}\x{c4}\x{81}\x{7a}", "\x{e3}\x{83}\x{86}\x{e3}\x{82}\x{b9}\x{e3}\x{83}\x{88}" ], '@ARGV as utf-8 octets'; } # Test the standard handles are NOT utf-8 my $utf8_flag = 1; for my $fh (*STDIN, *STDOUT, *STDERR) { my @layers = PerlIO::get_layers($fh); SKIP: { # If we have the Perl Unicode flag set that adds the UTF-8 layer, # we need to skip this test. skip 'Perl Unicode flag set that always adds UTF-8 layer', 1 if (${^UNICODE} & $utf8_flag); ok(!grep(/utf8/, @layers), q{utf8 does not appear in perlio layers}) or diag explain { $fh => \@layers }; } ok(!grep(m/utf-?8[-_]strict/, @layers), q{utf-?8[-_]strict does not appear in the perlio layers}) or diag explain { $fh => \@layers }; $utf8_flag *= 2; } ok((open my $test_fh, ">", "perlio_test"), 'open file for writing with utf8::all'); END { unlink "perlio_test" } my @layers = PerlIO::get_layers($test_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 }; done_testing; utf8-all-0.024/t/lexical-again.t000644 000766 000024 00000004446 13223632574 016424 0ustar00hayostaff000000 000000 #!perl # no utf8::all should disable its effects lexically # Note: Changes to @ARGV, STDIN, STDOU, and STDERR are always global! use Test::More tests => 17; use PerlIO; my $expected_unicode = "\x{30c6}\x{30b9}\x{30c8}"; # Unicode characters my $expected_utf8 = "\x{e3}\x{83}\x{86}\x{e3}\x{82}\x{b9}\x{e3}\x{83}\x{88}"; # UTF-8 encoded octets use utf8::all; is "テスト" => $expected_unicode, 'Literal string should be characters under utf8::all'; { no utf8::all; is "テスト" => $expected_utf8, 'Literal string should be utf-8 encoded octets without utf8::all'; # Test the standard handles and all newly opened handles are not utf8 ok((open my $out, ">", "lexical_octets.tmp"), 'open file for writing without utf8::all'); END { unlink "lexical_octets.tmp" } ok((open my $in, '<', 'corpus/testfile'), 'open file for reading without utf8::all'); my $contents = do { local $/; <$in>}; is $contents, "$expected_utf8\n", 'octets retreived OK'; my %handles = ( IN => $in, OUT => $out, ); for my $fh (keys %handles) { my @layers = PerlIO::get_layers($handles{$fh}); ok(!grep(m/utf8/, @layers), "$fh: utf8 does not appear in the perlio layers") or diag explain { $fh => \@layers }; ok(!grep(m/utf-?8[-_]strict/, @layers), "$fh: utf-?8[-_]strict does not appear in the perlio layers") or diag explain { $fh => \@layers }; } } is "テスト" => $expected_unicode, 'Literal string should be characters under utf8::all (again)'; # Test the standard handles and all newly opened handles are utf8 (again) ok((open my $out, ">", "lexical_unicode.tmp"), 'open file for writing with utf8::all'); END { unlink "lexical_unicode.tmp" } ok((open my $in, '<', 'corpus/testfile'), 'open file for reading with utf8::all'); my $contents = do { local $/; <$in>}; is $contents, "$expected_unicode\n", 'unicode retrieved OK'; my %handles = ( IN => $in, OUT => $out, ); for my $fh (keys %handles) { my @layers = PerlIO::get_layers($handles{$fh}); ok(grep(m/utf8/, @layers), "$fh: utf8 does appear in the perlio layers") or diag explain { $fh => \@layers }; ok(grep(m/utf-?8[-_]strict/, @layers), "$fh: utf-?8[-_]strict does appear in the perlio layers") or diag explain { $fh => \@layers }; } utf8-all-0.024/t/lexical.t000644 000766 000024 00000001317 13223632574 015341 0ustar00hayostaff000000 000000 #!perl # utf8::all should have lexical effect (except for @ARGV!) use Test::More tests => 4; my $expected_unicode = "\x{30c6}\x{30b9}\x{30c8}"; # Unicode characters my $expected_utf8 = "\x{e3}\x{83}\x{86}\x{e3}\x{82}\x{b9}\x{e3}\x{83}\x{88}"; # UTF-8 encoded octets is "テスト" => $expected_utf8, 'Literal string should be utf-8 encoded octets without utf8::all'; { use utf8::all; is "テスト" => $expected_unicode, 'Literal string should be characters under utf8::all'; } is "テスト" => $expected_utf8, 'Literal string should be utf-8 encoded octets without utf8::all (again)'; use utf8::all; is "テスト" => $expected_unicode, 'Literal string should be characters under utf8::all (again)'; utf8-all-0.024/t/no_global.t000644 000766 000024 00000003625 13223632574 015660 0ustar00hayostaff000000 000000 #!perl # Test that ust8::all with NO-GLOBAL does not change @ARGV, STDIN, STDOUT, STDERR use strict; use warnings; BEGIN { # String literals are still utf-8 encoded octets here! @ARGV = qw(føø bar bāz テスト); } use utf8::all 'NO-GLOBAL'; use PerlIO; use Test::More; SKIP: { # If we run with the Perl Unicode flag to automatically # convert the command-line arguments to unicode characters, # we need to skip this test skip 'Perl Unicode flag set to automatically convert command-line arguments', 1 if (${^UNICODE} & 32); # føø bar bāz テスト still as utf-8 encoded octets is_deeply \@ARGV => [ "\x{66}\x{c3}\x{b8}\x{c3}\x{b8}", "\x{62}\x{61}\x{72}", "\x{62}\x{c4}\x{81}\x{7a}", "\x{e3}\x{83}\x{86}\x{e3}\x{82}\x{b9}\x{e3}\x{83}\x{88}" ], '@ARGV as utf-8 octets'; } # Test the standard handles are NOT utf-8 my $utf8_flag = 1; for my $fh (*STDIN, *STDOUT, *STDERR) { my @layers = PerlIO::get_layers($fh); SKIP: { # If we have the Perl Unicode flag set that adds the UTF-8 layer, # we need to skip this test. skip 'Perl Unicode flag set that always adds UTF-8 layer', 1 if (${^UNICODE} & $utf8_flag); ok(!grep(/utf8/, @layers), q{utf8 does not appear in perlio layers}) or diag explain { $fh => \@layers }; } ok(!grep(m/utf-?8[-_]strict/, @layers), q{utf-?8[-_]strict does not appear in the perlio layers}) or diag explain { $fh => \@layers }; $utf8_flag *= 2; } ok((open my $test_fh, ">", "perlio_test"), 'open file for writing with utf8::all'); END { unlink "perlio_test" } my @layers = PerlIO::get_layers($test_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 }; done_testing; utf8-all-0.024/t/open.t000644 000766 000024 00000000777 13223632574 014672 0ustar00hayostaff000000 000000 #!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, "\x{30c6}\x{30b9}\x{30c8}\n", 'unicode retrieved OK'; utf8-all-0.024/t/readdir.t000644 000766 000024 00000003521 13223632574 015331 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96; use Encode qw/decode FB_CROAK/; plan skip_all => "$^O does not have proper utf-8 file system support" if $^O =~ /MSWin32|cygwin|dos|os2/; mkdir "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}" or die "Couldn't create directory corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}: $!" unless -d "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}"; plan tests => 3; 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.024/t/readlink.t000644 000766 000024 00000002241 13223632574 015506 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96; use Encode qw/find_encoding FB_CROAK LEAVE_SRC/; plan skip_all => "$^O does not have proper utf-8 file system support" if $^O =~ /MSWin32|cygwin|dos|os2/; mkdir "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}" or die "Couldn't create directory corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}: $!" unless -d "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}"; symlink "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}", "testlink.tmp" or die "Couldn't create symlink from testlink.tmp: $!"; END { unlink("testlink.tmp") or die "Unable to remove testlink.tmp: $!" if -l "testlink.tmp"; } my $_UTF8 = find_encoding('UTF-8'); plan tests => 3; my $linkdest = readlink('testlink.tmp'); my $utf8_linkdest; { use utf8::all; $utf8_linkdest = readlink('testlink.tmp'); } is $utf8_linkdest => "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}", 'utf8 linkdest should be as expected'; is $linkdest => $_UTF8->encode($utf8_linkdest, FB_CROAK | LEAVE_SRC), 'encoded utf8 linkdest matches non-utf8'; is $_UTF8->decode($linkdest, FB_CROAK | LEAVE_SRC) => $utf8_linkdest, 'utf8 linkdest matches decoded non-utf8'; utf8-all-0.024/t/readpipe.t000644 000766 000024 00000003274 13223632574 015515 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96; use Encode qw/find_encoding FB_CROAK LEAVE_SRC/; plan skip_all => "$^O does not have proper utf-8 file system support" if $^O =~ /MSWin32|cygwin|dos|os2/; mkdir "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}" or die "Couldn't create directory corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}: $!" unless -d "corpus/\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}"; my $_UTF8 = find_encoding('UTF-8'); plan tests => 3*3; my $cmd = 'ls -1 corpus'; my $expected = "testfile\n\x{307f}\x{304b}\x{3061}\x{3083}\x{3093}\n"; my $result; my $utf8_result; sub sort_res { return join("\n", sort(split("\n", shift))); } sub test_res { my $test = shift; my $result = shift; my $utf8_result = shift; is sort_res($utf8_result) => sort_res($expected), "$test utf8 result should be as expected"; SKIP: { # If we have the Perl Unicode flag set that adds the UTF-8 layer, # we need to skip these tests. skip 'Perl Unicode flag set that always adds UTF-8 layer to input', 2 if (${^UNICODE} & 8); is $result => $_UTF8->encode($utf8_result, FB_CROAK | LEAVE_SRC), "$test encoded utf8 result matches non-utf8"; is $_UTF8->decode($result, FB_CROAK | LEAVE_SRC) => $utf8_result, "$test utf8 result matches decoded non-utf8"; } } # readpipe $result = readpipe($cmd); { use utf8::all; $utf8_result = readpipe($cmd); } test_res('readpipe', $result, $utf8_result); # Backtick $result = `$cmd`; { use utf8::all; $utf8_result = `$cmd`; } test_res('Backtick', $result, $utf8_result); # qx $result = qx{$cmd}; { use utf8::all; $utf8_result = qx{$cmd}; } test_res('qx', $result, $utf8_result); utf8-all-0.024/t/threads.t000644 000766 000024 00000001312 13223632574 015345 0ustar00hayostaff000000 000000 #!perl # Test that utf8::all is choosing the right encoding to not tickle # thread bugs. use strict; use warnings; # This is loaded before threads. It will not be aware of tests run in # a thread. use Test::More 0.96; use Config; BEGIN { plan skip_all => "Requires threads" if !$Config{usethreads}; plan skip_all => "Thread support on Perl <= v5.10.0 is unstable" if $^V <= v5.10.0; plan tests => 1; } # Deliberately before loading threads so we don't cheat and check # if threads are loaded, that would be brittle. use utf8::all; use threads; use threads::shared; my $ok :shared = 0; my $t = threads->create(sub { $ok = 1; }); $t->join(); ok $ok, "threads ok with utf8::all"; utf8-all-0.024/t/unicode_eval.t000644 000766 000024 00000001341 13223632574 016352 0ustar00hayostaff000000 000000 #!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.024/t/unicode_strings.t000644 000766 000024 00000004435 13223632574 017123 0ustar00hayostaff000000 000000 #!perl # utf8::all should turn on feature qw(unicode_strings) use strict; use warnings; use Config; use Test::More; plan $^V >= v5.14.0 ? (tests => 13) : (skip_all => q/character set modifiers aren't available until 5.14.0/); use constant HAVE_LOCALE => $Config{i_locale}; 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$/; SKIP: { skip "No locale on this system, /l flag not present", 1 if !HAVE_LOCALE; 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'); SKIP: { skip "No locale on this system, /l flag not present", 1 if !HAVE_LOCALE; is(qr/abc$locale/, '(?^u:abc(?^l:\b\v$))', 'Verify retains l when interpolated under unicode_strings'); } no feature 'unicode_strings'; SKIP: { skip "No locale on this system, /l flag not present", 1 if !HAVE_LOCALE; 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; SKIP: { skip "No locale on this system, /l flag not present", 2 if !HAVE_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.024/t/utf8.t000644 000766 000024 00000003031 13223632574 014601 0ustar00hayostaff000000 000000 #!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, 'unicode string is characters'; # Test the standard handles and all newly opened handles are utf8 ok((open my $test_fh, ">", "perlio_test"), 'open file for writing with utf8::all'); 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 { $fh => \@layers }; ok(grep(m/utf-?8[-_]strict/, @layers), 'utf-?8[-_]strict appears in the perlio layers') or diag explain { $fh => \@layers }; } } # And off { is length "utf8::all is MËTÁŁ" => 21, 'unicode string is octets'; ok((open my $test_fh, ">", "perlio_test2"), 'open file for writing with utf8::all'); END { unlink "perlio_test2" } my @layers = PerlIO::get_layers($test_fh); SKIP: { # If we have the Perl Unicode flag set that adds the UTF-8 layer, # we need to skip this test. skip 'Perl Unicode flag set that always adds UTF-8 layer to output', 1 if (${^UNICODE} & 16); ok(!grep(/utf8/, @layers), q{utf8 does not appear in perlio layers}) or diag explain { $test_fh => \@layers }; } ok(!grep(m/utf-?8[-_]strict/, @layers), q{utf-?8[-_]strict does not appear in the perlio layers}) or diag explain { $test_fh => \@layers }; } done_testing; utf8-all-0.024/t/utf8_check.t000644 000766 000024 00000003340 13223632574 015741 0ustar00hayostaff000000 000000 #!perl use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; plan skip_all => "$^O does not have proper utf-8 file system support" if $^O =~ /MSWin32|cygwin|dos|os2/; plan tests => 6; # Tests if setting $utf8::all::UTF8_CHECK has the required result use Encode (); use utf8::all; no warnings FATAL => 'utf8'; # disable fatal utf8 warnings # String with an illegal Unicode character my $faulty_string = "Illegal \x{d800} character"; # Warn on faulty utf-8 { local $utf8::all::UTF8_CHECK = Encode::FB_WARN; Test::Warn::warning_like { glob($faulty_string); } qr/"\\x\{d800\}" does not map to (utf8|UTF-8)/, 'warn on encoding error: glob'; Test::Warn::warning_like { readlink($faulty_string); } qr/"\\x\{d800\}" does not map to (utf8|UTF-8)/, 'warn on encoding error: readlink'; } # Croak on faulty utf-8 { Test::Exception::throws_ok { glob($faulty_string); } qr/"\\x\{d800\}" does not map to (utf8|UTF-8)/, 'croak on encoding error (default): glob'; Test::Exception::throws_ok { readlink($faulty_string); } qr/"\\x\{d800\}" does not map to (utf8|UTF-8)/, 'croak on encoding error (default): readlink'; } # Nothing on faulty utf-8 { local $utf8::all::UTF8_CHECK = Encode::FB_DEFAULT; Test::Warn::warning_is { glob($faulty_string); } [], 'no warn on encoding error: glob'; Test::Warn::warning_is { readlink($faulty_string); } [], 'no warn on encoding error: readlink'; } utf8-all-0.024/lib/utf8/000755 000766 000024 00000000000 13223632574 014722 5ustar00hayostaff000000 000000 utf8-all-0.024/lib/utf8/all.pm000644 000766 000024 00000037656 13223632574 016051 0ustar00hayostaff000000 000000 package utf8::all; use strict; use warnings; use 5.010; # state # ABSTRACT: turn on Unicode - all of it our $VERSION = '0.024'; # VERSION #pod =head1 SYNOPSIS #pod #pod use utf8::all; # Turn on UTF-8, all of it. #pod #pod open my $in, '<', 'contains-utf8'; # UTF-8 already turned on here #pod print length 'føø bār'; # 7 UTF-8 characters #pod my $utf8_arg = shift @ARGV; # @ARGV is UTF-8 too (only for main) #pod #pod =head1 DESCRIPTION #pod #pod The C pragma tells the Perl parser to allow UTF-8 in the #pod program text in the current lexical scope. This also means that you #pod can now use literal Unicode characters as part of strings, variable #pod names, and regular expressions. #pod #pod C goes further: #pod #pod =over 4 #pod #pod =item * #pod #pod L|charnames> are imported so C<\N{...}> sequences can be #pod used to compile Unicode characters based on names. #pod #pod =item * #pod #pod On Perl C or higher, the C is #pod enabled. #pod #pod =item * #pod #pod C and C are enabled on Perl #pod C<5.16.0> and higher. #pod #pod =item * #pod #pod Filehandles are opened with UTF-8 encoding turned on by default #pod (including C, C, and C when C is #pod used from the C
package). Meaning that they automatically #pod convert UTF-8 octets to characters and vice versa. If you I #pod want UTF-8 for a particular filehandle, you'll have to set C. #pod #pod =item * #pod #pod C<@ARGV> gets converted from UTF-8 octets to Unicode characters (when #pod C is used from the C
package). This is similar to the #pod behaviour of the C<-CA> perl command-line switch (see L). #pod #pod =item * #pod #pod C, C, C (including the C and #pod backtick operators), and L|perlfunc/glob> (including the C<< #pod <> >> operator) now all work with and return Unicode characters #pod instead of (UTF-8) octets (again only when C is used from #pod the C
package). #pod #pod =back #pod #pod =head2 Lexical Scope #pod #pod The pragma is lexically-scoped, so you can do the following if you had #pod some reason to: #pod #pod { #pod use utf8::all; #pod open my $out, '>', 'outfile'; #pod my $utf8_str = 'føø bār'; #pod print length $utf8_str, "\n"; # 7 #pod print $out $utf8_str; # out as utf8 #pod } #pod open my $in, '<', 'outfile'; # in as raw #pod my $text = do { local $/; <$in>}; #pod print length $text, "\n"; # 10, not 7! #pod #pod Instead of lexical scoping, you can also use C to turn #pod off the effects. #pod #pod Note that the effect on C<@ARGV> and the C, C, and #pod C file handles is always global and can not be undone! #pod #pod =head2 Enabling/Disabling Global Features #pod #pod As described above, the default behaviour of C is to #pod convert C<@ARGV> and to open the C, C, and C #pod file handles with UTF-8 encoding, and override the C and #pod C functions and C operators when C is used #pod from the C
package. #pod #pod If you want to disable these features even when C is used #pod from the C
package, add the option C (or #pod C) to the use line. E.g.: #pod #pod use utf8::all 'NO-GLOBAL'; #pod #pod If on the other hand you want to enable these global effects even when #pod C was used from another package than C
, use the #pod option C on the use line: #pod #pod use utf8::all 'GLOBAL'; #pod #pod =head2 UTF-8 Errors #pod #pod C will handle invalid code points (i.e., utf-8 that does #pod not map to a valid unicode "character"), as a fatal error. #pod #pod For C, C, and C, one can change this #pod behaviour by setting the attribute L. #pod #pod =head1 COMPATIBILITY #pod #pod The filesystems of Dos, Windows, and OS/2 do not (fully) support #pod UTF-8. The C and C functions and C operators #pod will therefore not be replaced on these systems. #pod #pod =head1 SEE ALSO #pod #pod =over 4 #pod #pod =item * #pod #pod L for fully utf-8 aware File::Find functions. #pod #pod =item * #pod #pod L for fully utf-8 aware Cwd functions. #pod #pod =back #pod #pod =cut use Import::Into; use parent qw(Encode charnames utf8 open warnings feature); use Symbol qw(qualify_to_ref); use Config; # Holds the pointers to the original version of redefined functions state %_orig_functions; # Current (i.e., this) package my $current_package = __PACKAGE__; require Carp; $Carp::Internal{$current_package}++; # To get warnings reported at correct caller level #pod =attr $utf8::all::UTF8_CHECK #pod #pod By default C marks decoding errors as fatal (default value #pod for this setting is C). If you want, you can change this by #pod setting C<$utf8::all::UTF8_CHECK>. The value C reports #pod the encoding errors as warnings, and C will completely #pod ignore them. Please see L for details. Note: C is #pod I enforced. #pod #pod Important: Only controls the handling of decoding errors in C, #pod C, and C. #pod #pod =cut use Encode (); use PerlIO::utf8_strict; our $UTF8_CHECK = Encode::FB_CROAK | Encode::LEAVE_SRC; # Die on encoding errors # UTF-8 Encoding object my $_UTF8 = Encode::find_encoding('UTF-8'); sub import { # Enable features/pragmas in calling package my $target = caller; # Enable global effects be default only when imported from main package my $no_global = $target ne 'main'; # Override global? if (defined $_[1] && $_[1] =~ /^(?:(NO-)?GLOBAL|LEXICAL-ONLY)$/i) { $no_global = $_[1] !~ /^GLOBAL$/i; splice(@_, 1, 1); # Remove option from import's arguments } 'utf8'->import::into($target); 'open'->import::into($target, 'IO' => ':utf8_strict'); # use open ':std' only works with some encodings. state $have_encoded_std = 0; unless ($no_global || $have_encoded_std++) { binmode STDERR, ':utf8_strict'; binmode STDOUT, ':utf8_strict'; binmode STDIN, ':utf8_strict'; } '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; unless ($no_global || $^O =~ /MSWin32|cygwin|dos|os2/) { no strict qw(refs); ## no critic (TestingAndDebugging::ProhibitNoStrict) no warnings qw(redefine); # Replace readdir with utf8 aware version *{$target . '::readdir'} = \&_utf8_readdir; # Replace readdir with utf8 aware version *{$target . '::readlink'} = \&_utf8_readlink; # Replace glob with utf8 aware version *{$target . '::glob'} = \&_utf8_glob; # Set compiler hint to encode/decode in the redefined functions $^H{'utf8::all'} = 1; } # Make @ARGV utf-8 when, unless perl was launched with the -CA # flag as this already has @ARGV decoded automatically. -CA is # active if the the fifth bit (32) of the ${^UNICODE} variable is # set. (see perlrun on the -C command switch for details about # ${^UNICODE}) unless ($no_global || (${^UNICODE} & 32)) { state $have_encoded_argv = 0; if (!$have_encoded_argv++) { $UTF8_CHECK |= Encode::LEAVE_SRC if $UTF8_CHECK; # Enforce LEAVE_SRC $_ = ($_ ? $_UTF8->decode($_, $UTF8_CHECK) : $_) for @ARGV; } } return; } sub unimport { ## no critic (Subroutines::ProhibitBuiltinHomonyms) # Disable features/pragmas in calling package # Note: Does NOT undo the effect on @ARGV, # nor on the STDIN, STDOUT, and STDERR file handles! # These effects are always "global". my $target = caller; 'utf8'->unimport::out_of($target); 'open'->import::into($target, qw{IO :bytes}); unless ($^O =~ /MSWin32|cygwin|dos|os2/) { $^H{'utf8::all'} = 0; # Reset compiler hint } return; } sub _utf8_readdir(*) { ## no critic (Subroutines::ProhibitSubroutinePrototypes) my $pre_handle = shift; my $hints = (caller 0)[10]; my $handle = ref($pre_handle) ? $pre_handle : qualify_to_ref($pre_handle, caller); if (not $hints->{'utf8::all'}) { return CORE::readdir($handle); } else { $UTF8_CHECK |= Encode::LEAVE_SRC if $UTF8_CHECK; # Enforce LEAVE_SRC if (wantarray) { return map { $_ ? $_UTF8->decode($_, $UTF8_CHECK) : $_ } CORE::readdir($handle); } else { my $r = CORE::readdir($handle); return $r ? $_UTF8->decode($r, $UTF8_CHECK) : $r; } } } sub _utf8_readlink(_) { ## no critic (Subroutines::ProhibitSubroutinePrototypes) my $arg = shift; my $hints = (caller 0)[10]; if (not $hints->{'utf8::all'}) { return CORE::readlink($arg); } else { $UTF8_CHECK |= Encode::LEAVE_SRC if $UTF8_CHECK; # Enforce LEAVE_SRC $arg = $arg ? $_UTF8->encode($arg, $UTF8_CHECK) : $arg; my $r = CORE::readlink($arg); return $r ? $_UTF8->decode($r, $UTF8_CHECK) : $r; } } sub _utf8_glob { my $arg = $_[0]; # Making this a lexical somehow is important! my $hints = (caller 0)[10]; if (not $hints->{'utf8::all'}) { return CORE::glob($arg); } else { $UTF8_CHECK |= Encode::LEAVE_SRC if $UTF8_CHECK; # Enforce LEAVE_SRC $arg = $arg ? $_UTF8->encode($arg, $UTF8_CHECK) : $arg; if (wantarray) { return map { $_ ? $_UTF8->decode($_, $UTF8_CHECK) : $_ } CORE::glob($arg); } else { my $r = CORE::glob($arg); return $r ? $_UTF8->decode($r, $UTF8_CHECK) : $r; } } } #pod =head1 INTERACTION WITH AUTODIE #pod #pod If you use L, which is a great idea, you need to use at least #pod version B<2.12>, released on L. #pod Otherwise, autodie obliterates the IO layers set by the L #pod pragma. See L and L. #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME utf8::all - turn on Unicode - all of it =head1 VERSION version 0.024 =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 (only for main) =head1 DESCRIPTION The C pragma tells the Perl parser to allow UTF-8 in the program text in the current lexical scope. This also means that you can now use literal Unicode characters as part of strings, variable names, and regular expressions. C goes further: =over 4 =item * L|charnames> are imported so C<\N{...}> sequences can be used to compile Unicode characters based on names. =item * On Perl C or higher, the C is enabled. =item * C and C are enabled on Perl C<5.16.0> and higher. =item * Filehandles are opened with UTF-8 encoding turned on by default (including C, C, and C when C is used from the C
package). Meaning that they automatically convert UTF-8 octets to characters and vice versa. If you I want UTF-8 for a particular filehandle, you'll have to set C. =item * C<@ARGV> gets converted from UTF-8 octets to Unicode characters (when C is used from the C
package). This is similar to the behaviour of the C<-CA> perl command-line switch (see L). =item * C, C, C (including the C and backtick operators), and L|perlfunc/glob> (including the C<< <> >> operator) now all work with and return Unicode characters instead of (UTF-8) octets (again only when C is used from the C
package). =back =head2 Lexical Scope 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! Instead of lexical scoping, you can also use C to turn off the effects. Note that the effect on C<@ARGV> and the C, C, and C file handles is always global and can not be undone! =head2 Enabling/Disabling Global Features As described above, the default behaviour of C is to convert C<@ARGV> and to open the C, C, and C file handles with UTF-8 encoding, and override the C and C functions and C operators when C is used from the C
package. If you want to disable these features even when C is used from the C
package, add the option C (or C) to the use line. E.g.: use utf8::all 'NO-GLOBAL'; If on the other hand you want to enable these global effects even when C was used from another package than C
, use the option C on the use line: use utf8::all 'GLOBAL'; =head2 UTF-8 Errors C will handle invalid code points (i.e., utf-8 that does not map to a valid unicode "character"), as a fatal error. For C, C, and C, one can change this behaviour by setting the attribute L. =head1 ATTRIBUTES =head2 $utf8::all::UTF8_CHECK By default C marks decoding errors as fatal (default value for this setting is C). If you want, you can change this by setting C<$utf8::all::UTF8_CHECK>. The value C reports the encoding errors as warnings, and C will completely ignore them. Please see L for details. Note: C is I enforced. Important: Only controls the handling of decoding errors in C, C, and C. =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 BUGS Please report any bugs or feature requests on the bugtracker L. When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 COMPATIBILITY The filesystems of Dos, Windows, and OS/2 do not (fully) support UTF-8. The C and C functions and C operators will therefore not be replaced on these systems. =head1 SEE ALSO =over 4 =item * L for fully utf-8 aware File::Find functions. =item * L for fully utf-8 aware Cwd functions. =back =head1 AUTHORS =over 4 =item * Michael Schwern =item * Mike Doherty =item * Hayo Baan =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schwern ; he originated it. 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.024/corpus/testfile000644 000766 000024 00000000012 13223632574 016334 0ustar00hayostaff000000 000000 テスト