Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: French Accent in Windows Registry

by Ieronim (Friar)
on Jul 27, 2006 at 13:28 UTC ( [id://564077]=note: print w/replies, xml ) Need Help??


in reply to French Accent in Windows Registry

Your code does something very silly. You confuse encode and decode. I myself confused them for a very long time, and learned the difference only on PerlMonks.

Let's look what you do: at first you encode the string received from terminal into utf8, and then you DECODE IT BACK! So it's again in the encoding of your terminal. So there is no wonder that you can print it back to the terminal, but the Windows Registry of course misinterpretes it.

You need

$val = <STDIN>; from_to($val, $enc, "UTF-16");
$val = <STDIN>; from_to($val, $enc, "UTF-16");
where $enc is the encoding of your input data, 'cp1250', i suppose.
$val = <STDIN>; from_to($val, 'cp850', 'cp1252');
UPDATE: Added the most likely variant according to tye's note—but it can still be wrong. You need to convert from 'dos' French codepage to 'Windows' French codepage. I inserted the values for Western European codepage.

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Replies are listed 'Best First'.
Re^2: French Accent in Windows Registry
by duc (Beadle) on Jul 27, 2006 at 13:56 UTC

    I knew I was doing something wrong ! I have a little something against unclear documentation... Anyway, I guess it is a start but since cp1250 with UTF-16 combination is not working, I will have to go through the possibilities !

    Thanks a lot to you !

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found