Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve the UTF8 problem #47

Closed
schwern opened this issue Aug 28, 2010 · 5 comments
Closed

Solve the UTF8 problem #47

schwern opened this issue Aug 28, 2010 · 5 comments

Comments

@schwern
Copy link
Contributor

schwern commented Aug 28, 2010

Test::Builder has a problem that when it clones filehandles it does not clone their layers. This means even if you make STDERR and STDOUT utf8 sensitive TB1 won't see that in its dup'd filehandles.

There was an attempt to clone the I/O layers, but it failed due to Perl bugs. This has to be fixed in TB2.

At minimum a method to quickly apply I/O layers to all the output handles.

@briandfoy
Copy link

This issue is also in Google Code with a temporary kludgy fix:

binmode Test::More->builder->output, ":utf8";
binmode Test::More->builder->failure_output, ":utf8";

@briandfoy
Copy link

Which commit represents Test::More 0.98? I'd like to branch off that commit and potentially fix this.

@briandfoy
Copy link

I've also found that using the -CS or PERL_UNICODE='' with Perl 5.14 fixes this too:

$ perl5.14 -CS t/test.t
$ env PERL_UNICODE='' perl5.14 t/test.t

@schwern
Copy link
Contributor Author

schwern commented Aug 12, 2011

The v0.98 tag is what you're looking for. https://github.com/schwern/test-more/tree/v0.98 But new work would be better done off master. I'll just have to merge it anyway.

See 401fa01. Test::More 0.98 will inherit I/O layers from STDOUT and STDERR IF AND ONLY IF those layers are set before Test::More loads. That's probably why PERL_UNICODE works.

What's your plan?

@schwern
Copy link
Contributor Author

schwern commented Nov 22, 2011

I think Test::Builder1.5 mitigates this problem well enough to close this.

Test::Builder1.5 delays copying STDOUT and STDERR until they're needed. That gives more space for the test author to set up encodings on them before testing starts.

The Test::More docs have been updated to explain how to deal with this problem.

The todo_output() handle is no longer relevant making it easier to set encodings on just two handles instead of three.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants