-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch for Issue #5, use Content-Type charset to decode content
- Loading branch information
1 parent
95f975f
commit 8f94a05
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use v6; | ||
|
||
use Test; | ||
use Test::When <online>; | ||
|
||
use LibCurl::Easy; | ||
|
||
my $version = LibCurl::Easy.version; | ||
|
||
my $curl = LibCurl::Easy.new(URL => 'http://greenbytes.de/tech/tc/httpcontenttype/textplainutf8.asis') | ||
.perform; | ||
|
||
is $curl.content, "Umlaute: äöüÄÖÜ Euro: €\n", | ||
'Check decoded content, charset=UTF-8'; | ||
|
||
|
||
$curl.URL('http://greenbytes.de/tech/tc/httpcontenttype/textplainutf8qs.asis') | ||
.perform; | ||
|
||
is $curl.content, "Umlaute: äöüÄÖÜ Euro: €\n", | ||
'Check decoded content, charset="UTF-8"'; | ||
|
||
$curl.URL('http://greenbytes.de/tech/tc/httpcontenttype/textplainutf8ws.asis') | ||
.perform; | ||
|
||
is $curl.content, "Umlaute: äöüÄÖÜ Euro: €\n", | ||
'Check decoded content, charset = UTF-8'; | ||
|
||
|
||
$curl.URL('http://greenbytes.de/tech/tc/httpcontenttype/textplainutf8qsa.asis') | ||
.perform; | ||
|
||
is $curl.content, "Umlaute: äöüÄÖÜ Euro: €\n", | ||
"Check decoded content, charset='UTF-8'"; | ||
|
||
$curl.URL('http://greenbytes.de/tech/tc/httpcontenttype/textplainutf8extparam.asis') | ||
.perform; | ||
|
||
is $curl.content, "Umlaute: äöüÄÖÜ Euro: €\n", | ||
'Check decoded content, charset="UTF-8"'; | ||
|
||
|
||
$curl.URL('http://greenbytes.de/tech/tc/httpcontenttype/textplainutf8extparamqs1.asis') | ||
.perform; | ||
|
||
is $curl.content, "Umlaute: äöüÄÖÜ Euro: €\n", | ||
'Check decoded content, charset=\"UTF-8\"'; | ||
|
||
done-testing; |