Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Win32 encoding conversion mystery

by mithaldu (Monk)
on Aug 13, 2018 at 17:58 UTC ( [id://1220301]=note: print w/replies, xml ) Need Help??


in reply to Re: Win32 encoding conversion mystery
in thread Win32 encoding conversion mystery

Thank you!

You provided both the correct answer, which is that i needed to encode the UTF8 string i got to code page 437, and provided it in massive detail. This was the exact chain i need to get useful modern UTF8. :D

my $safe = Encode::FB_CROAK | Encode::LEAVE_SRC; my $text = decode 'cp932', (encode "cp".Win32::GetOEMCP(), $windows_wi +de_filename, $safe), $safe;

Replies are listed 'Best First'.
Re^3: Win32 encoding conversion mystery
by ikegami (Patriarch) on Aug 15, 2018 at 23:09 UTC

    The actual code page you want is probably the one returned by "cp".Win32::GetOEMCP() or "cp".Win32::GetConsoleOutputCP(), not cp437. It's cp850 on my machine, for example. I think it's because I'm using "English (Canada)" instead of "English (US)".

      Thanks for the additional info, that is useful. I amended the post.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found