It would be best if you could find out the actual encoding of the page, i.e. whether it's UTF-8, UTF-16 (LE or BE), etc. If you're not sure, you could also post the URL here. Then, depending on how you're loading that data into Perl (which HTTP client etc.) you may need to additionally decode the data. As choroba said, please show your code (see SSCCE).

Also, you said you get question marks on output - you also need to tell Perl how to encode its output to the console, e.g. via use open qw/:std :utf8/;. However, I would suggest first checking whether the strings have been decoded properly, using Dump($string) from Devel::Peek.


In reply to Re: Perl not recognizing Chinese by haukex
in thread Perl not recognizing Chinese by grsampson

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.