I have a simple web page that uses CGI.pm This is what I do:

when I call any perl CGI.pm function and use czech character "ě" for value of a textfield, label of radio_group or anything else I get �› insetad of "ě"

this is extremly weird - since the whole page is utf8 (<meta name="charset" content="utf-8"/> ). Especially since this works

$textfield_value = "ěěěěě";
print '<textfield value="'.$textfield_value.'" >';

therefore I am positive - it has to be CGI.pm causing the problem... I tried to put

use utf8; utf8::decode($textfield_value);

at the beginning of my scirpt and it fixed the CGI.pm problem but made all other characters in the script (those that are regulary printed) look funny..

Any ideas??? note: it happens to me here as well even as I edit this question -> what i previously wrote as ěěě is in edit window displayed as &#283;. The SAME thing with the Name of this thread is should be CGI.pm encoding - wrong encoding for ě and not CGI.pm encoding - wrong encoding for &#283;

In reply to CGI.pm encoding - wrong encoding for &#283; by koszta5

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.