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

[Unicode] Cannot print chr(0x00F6) properly #16547

Closed
p5pRT opened this issue May 5, 2018 · 5 comments
Closed

[Unicode] Cannot print chr(0x00F6) properly #16547

p5pRT opened this issue May 5, 2018 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented May 5, 2018

Migrated from rt.perl.org#133177 (status was 'rejected')

Searchable as RT133177$

@p5pRT
Copy link
Author

p5pRT commented May 5, 2018

From @tisonkun

* The Problem

$ perl -e 'print chr(0x00F6)'
?% $ perl -e 'print
chr(0x4396)'
Wide character in print at -e line 1.
�%

Where chr(0x00F6) should be ö and it is printed properly by Python or Perl
6 on my env so I infer that it is an issue about Perl.

* Version Info

$ perl -v

This is perl 5, version 26, subversion 2 (v5.26.2) built for
darwin-thread-multi-2level

Copyright 1987-2018, Larry Wall

Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http​://www.perl.org/, the Perl Home Page.

- PS​: Looking forward to your reply. At least let me know this e-mail has
been received. I used `perlbug` program some days ago and got no reply.

Alex.

@p5pRT
Copy link
Author

p5pRT commented May 9, 2018

From @khwilliamson

On Sat, 05 May 2018 01​:14​:34 -0700, wander4096@​gmail.com wrote​:

* The Problem

$ perl -e 'print chr(0x00F6)'
?% $ perl -e 'print
chr(0x4396)'
Wide character in print at -e line 1.
�%

Where chr(0x00F6) should be ö and it is printed properly by Python or Perl
6 on my env so I infer that it is an issue about Perl.

* Version Info

$ perl -v

This is perl 5, version 26, subversion 2 (v5.26.2) built for
darwin-thread-multi-2level

Copyright 1987-2018, Larry Wall

Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http​://www.perl.org/, the Perl Home Page.

- PS​: Looking forward to your reply. At least let me know this e-mail has
been received. I used `perlbug` program some days ago and got no reply.

Alex.

If you add the -C option, it works properly

perl -C -e 'print chr(0x00F6)'
ö

What I suspect is happening is that your terminal is set up for UTF-8 text. Perl is printing the F6, but that is illegal UTF-8, and so your terminal doesn't handle it as one might expect. Perl doesn't know what your terminal is set up for. Specifying the -C tells it.

With -C, perl converts the F6 to its UTF-8 representation before printing.

The reason anything above 0xFF does print correctly is that it can't possibly be represented by a single byte, and so Perl converts it to UTF-8, and your terminal is happy. But you get the wide character warning indicating that Perl expects your terminal to not be able to handle UTF-8.

I don't know why the other tools seem to work here.

Can you detail what happened when your perlbug failed?
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented May 9, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 31, 2018

From @khwilliamson

No response from OP. This ticket is not a perl issue.
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Jul 31, 2018

@khwilliamson - Status changed from 'open' to 'rejected'

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

No branches or pull requests

1 participant