What would be the name of this process?

Eh-h... just, 'encoding'?

Good news, decoding from CP932 (~ shiftjis) goes error-free, bad news, online translations (to English) seem to produce gibberish.

use strict; use warnings; use feature 'say'; use Encode qw/ encode decode /; my $a = join '', map chr, qw/ 226 123 226 78 233 9524 196 113 233 9568 196 191 233 8976 233 189 50 /; my $b = join '', map chr, qw/ 131 123 131 78 130 193 142 113 130 204 142 168 130 169 130 171 50 /; ############################ use Test::More; is $a, decode( 'cp437', $b, Encode::FB_CROAK | Encode::LEAVE_SRC ), 'f +rom b to a'; is $b, encode( 'cp437', $a, Encode::FB_CROAK | Encode::LEAVE_SRC ), 'f +rom a to b'; done_testing; ############################ use Win32; say Win32::GetACP; say Win32::GetOEMCP; say Win32::GetConsoleCP; ############################ use Imager; my $text = decode 'cp932', $b, Encode::FB_CROAK | Encode::LEAVE_SRC; my $image = Imager-> new( xsize => 300, ysize => 80 ); Imager::Font-> new( file => 'mona.ttf' ) -> align( string => $text, size => 30, color => 'white', x => $image-> getwidth/2, y => $image-> getheight/2, halign => 'center', valign => 'center', image => $image, ); $image-> write( file => 'jp.png' ); ############################ use Win32::LongPath; mkdirL $text;

In reply to Re: Win32 encoding conversion mystery by vr
in thread 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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.