Acme-FixIO
view release on metacpan or search on metacpan
---
abstract: 'Workaround for Windows chcp 65001 UTF-8 output bug '
author:
- 'Klaus Eichner <klaus03@gmail.com>'
build_requires:
Test::More: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.025, CPAN::Meta::Converter version 2.142060'
license: perl
meta-spec:
Makefile.PL view on Meta::CPAN
use strict;
use warnings;
use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Workaround for Windows chcp 65001 UTF-8 output bug ",
"AUTHOR" => "Klaus Eichner <klaus03\@gmail.com>",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Acme-FixIO",
"EXE_FILES" => [],
"LICENSE" => "perl",
"NAME" => "Acme::FixIO",
"PREREQ_PM" => {
"Exporter" => 0,
This archive contains the distribution Acme-FixIO,
version 0.02:
Workaround for Windows chcp 65001 UTF-8 output bug
This software is copyright (c) 2014 by Klaus Eichner.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v5.025.
lib/Acme/FixIO.pm view on Meta::CPAN
binmode(STDOUT, ':unix:encoding(utf8):crlf') or die "Can't binmode STDOUT because $!";
binmode(STDERR, ':unix:encoding(utf8):crlf') or die "Can't binmode STDERR because $!";
1;
__END__
=head1 NAME
Acme::FixIO - Workaround for Windows chcp 65001 UTF-8 output bug
=head1 SYNOPSIS
use Acme::FixIO;
print chr(300) x 3, chr(301), "UVW\n";
=head1 DESCRIPTION
This is the underlying problem:
The last octet is repeated when Perl outputs a UTF-8 encoded string in
cmd.exe, chcp 65001
Two StackOverflow articles with basically the same problem:
L<http://stackoverflow.com/questions/23416075> and
L<http://stackoverflow.com/questions/25585248>.
This is caused by a bug in Windows. When writing to a console set to code
page 65001, WriteFile() returns the number of characters written instead
of the number of bytes.
( run in 1.601 second using v1.01-cache-2.11-cpan-49f99fa48dc )