Hi, Roman,
I'm guessing here, but it looks like in this line,
$response = $useragent->request($request);
the variale $response contains UTF-16, and the next line is naïvely printing it as_string.
print $response->as_string; print "\n\n";
But before it can be printed, a conversion has to be performed.
Here is where my knowledge ends. Neither do I know how to detect this situatioon,
nor do I know how to convert from UTF-16 to UTF-8 or latin-1 (whatever you need,
UTF-8 preferred) in Perl.
Wikipedia has great articles about Unicode character representation and it's UTF-16/8 encoding.
You will probably have to read them until you understand the topic -- it took me several reads
to wrap my head around it.
I understand this: Webinject produces output in plain ASCII, which is compatible to both
UTF-8 and Latin-*. So inserting sniplets from UTF-8 web pages makes the output UTF-8,
inserting sniplets in Latin-* makes the output Latin-*. But sniplets in UTF-16 are
incompatible and need to be converted to UTF-8, so that the output is legal UTF-8.
Anybody else who can fill in here and help Roman or fix the code? I am out.
Regards
-Karsten
> > To unsubscribe from this group and stop receiving emails from it, send an email to
webinject+...@googlegroups.com <javascript:> <mailto:
webinject+...@googlegroups.com <javascript:>>.
> > For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.