What character set does perl use?

When you read strings in perl, shuffle them around and don't do much more, perl treats the strings as binary data.

Your Ω in UTF-8 is looks like this:

echo -n "Ω"|hexdump -C 00000000 e2 84 a6

(The Omega character in the paste isn't showing correctly in code examples, imagine it being there instead of the HTML escape sequence)

When you import that into a Latin1 database, it interprets that as a sequnce of Latin1 characters, which is "âè¦" in your case.

Now you said you converted that to utf-8. A Latin1 "\x{e2}" becomes c3 a2, or â as a character.

Now you have to reverse that process step by step. I wish you much patience, and a good read of Encode, perluniintro and perlunicode.

Or if you have the chance, restore your data from a backup, and dump it into an utf8 database in the first place.


In reply to Re: A Character Set Enquiry by moritz
in thread A Character Set Enquiry by Godsrock37

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.