I am running perl 5, version 24, subversion 3 (v5.24.3) built for MSWin32-x64-multi-thread (with 1 registered patch, see perl -V for more detail) (Active State).
Trying to parse HTML page encoded in UTF-8:
$request = new HTTP::Request('GET', $url);
$response = $ua->request($request);
$content = $response->content();
I parse the $content as one giant string using INDEX and SUBSTR functions, that works fine. HTML page contains string with value ÖBB and I need to insert it in the database exactly as ÖBB When I print it and insert in the db, instead of Ö I get some ascii characters.
NOTE: this question is not database related; MySQL handles utf-8 just fine, so if I insert value "ÖBB" it will take it no problem.
I've looked at great number of similar questions/answers here and in other forums and I am none wiser.
use utf-8 and binmode(STDOUT, ":utf8") has not worked for me... Would greatly appreciate a code snippet that would solve the issue, thank you.


chcpon the command line. If it says "65001", you're good in that regard. If not, typechcp 65001to activate the correct codepage. - Hollichcp 65001. - Polar Bear