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

Incorrect default encoding #29

Closed
zoffixznet opened this issue Jul 10, 2018 · 1 comment
Closed

Incorrect default encoding #29

zoffixznet opened this issue Jul 10, 2018 · 1 comment

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Jul 10, 2018

The site http://eckva.net does not set encoding in its Content-type header. I believe this module default to an incorrect encoding (ASCII) in such cases, as that site works fine in browsers, Perl 5's version of the module, and Perl 6's Cro::HTTP::Client:

perl -MLWP::Simple -wlE 'say get "http://eckva.net"'
`[...] <proper content> [...]
$ perl6 -MLWP::Simple -e 'say LWP::Simple.get: "http://eckva.net"'
Will not decode invalid ASCII (code point > 127 found)
  in method parse_response at /home/zoffix/rakudo/install/share/perl6/site/sources/5144DC413A3D6FEA44A2A1547406118DCF6B244D (LWP::Simple) line 328
  in method make_request at /home/zoffix/rakudo/install/share/perl6/site/sources/5144DC413A3D6FEA44A2A1547406118DCF6B244D (LWP::Simple) line 262
  in method request_shell at /home/zoffix/rakudo/install/share/perl6/site/sources/5144DC413A3D6FEA44A2A1547406118DCF6B244D (LWP::Simple) line 84
  in method get at /home/zoffix/rakudo/install/share/perl6/site/sources/5144DC413A3D6FEA44A2A1547406118DCF6B244D (LWP::Simple) line 31
  in block <unit> at -e line 1

$ perl6 -v
This is Rakudo version 2018.05-54-g148d7c5 built on MoarVM version 2018.05-57-g89dee3b
implementing Perl 6.c.

$ zef info LWP::Simple
- Identity: LWP::Simple:ver<0.103>:auth<Cosimo Streppone>
@jonathanstowe
Copy link
Member

Changing it to latin-1 seems to work and it all passes all the tests. Though I'm not actually seeing where the non-ASCII character is coming from with that URL.

I'll go with that fix and see how it goes.

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

2 participants