Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Edit: vr below has provided the correct answer: https://www.perlmonks.org/?node_id=1220300


I'm on windows and trying to rename some files from Shift_JIS to UTF8, and Perl is giving me the hardest time trying to do this because my system's codepage is Latin1.

I've tried googling various ways around this, but i'm in a situation where i've completely lost overview. So i'm hoping that someone here can give me a more concrete hint.

As follows, i have examples of the string as i get it from the Win32::LongPath api, along with its codepoint values; on the left. On the right is the ascii string of the filename as windows' own `dir` provides it, also with codepoints.

It is notable that the visuals of the string on the left are roughly what you get if you view the string on the right with a DOS ASCII font. So it looks like the Win32::LongPath api took the original string, and "upconverted" "invisible" characters to some utf8 equivalent?

What would be the name of this process?
Is there a reverse mapping of it?

Image form of the names: https://i.imgur.com/1tUzUrn.png

â{âNé┴Äqé╠Ä¿é⌐é½2 ƒ{ƒN‚ÁŽq&#13 +0;ÌŽ¨‚©‚«2 226 131 123 123 226 131 78 78 233 130 9524 193 196 142 113 113 233 130 9568 204 196 142 191 168 233 130 8976 169 233 130 189 171 50 50

In reply to Win32 encoding conversion mystery by mithaldu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found