Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: LWP::UserAgent; unable to copy extended ASCII

by Corion (Patriarch)
on Jun 06, 2022 at 09:49 UTC ( [id://11144445]=note: print w/replies, xml ) Need Help??


in reply to LWP::UserAgent; unable to copy extended ASCII

What you see is the Unicode replacement character that is printed whenever the target cannot accept the character. You should maybe also see some warning about "wide chars" from Perl.

Did you tell Perl that you want to output Unicode to STDOUT?

binmode STDOUT, ':encoding(UTF-8)';

Replies are listed 'Best First'.
Re^2: LWP::UserAgent; unable to copy extended ASCII
by haj (Vicar) on Jun 06, 2022 at 11:31 UTC

    Nitpick: "Unicode" is the name of the concept, not of a particular encoding. The character é can be represented in a variety of encodings, including good ol' ISO-8859-1. So... Perl doesn't complain about a wide character in this case.

    The remedy is correct as given: You want to print in the encoding which is understood by the print handle. This is indeed UTF-8 for "modern" Linux terminals.

Re^2: LWP::UserAgent; unable to copy extended ASCII
by wmfs (Acolyte) on Jun 06, 2022 at 16:08 UTC
    Thank you!
    binmode STDOUT, ':encoding(UTF-8)';
    solves my problem. I am very grateful. Bill S

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found