OK.

I am editing on Windows XP Pro using Notepad++ and Dreamweaver. The file is being edited from a remote installation on a LAN that is an SME Server, a Linux distribution. I run the remote script using PuTTY. I usually have to change the translation settings on PuTTY to Latin 2 to get uncorrupted characters on output.

What I am trying to do is take output from MySQL and print up an HTML page that displays these Croatian characters. MySQL requires some tinkering to get it to handle these characters correctly and only a recent version past 5.0 will do it. But at this point the difficulty is taking the characters that have survived output from MySQL and print them to a page generated by Perl. So the code is something like:

$HTML = encode( "iso-8859-2", $HTML);

while (<OLD>) {
s!<body>.*</body>!<body>$HTML</body>!gs;
print NEW $_ or die "can't write $new: $!";
}

But this isn't working. The output has changed, but the characters are not being preserved. I am getting erroneous characters instead of little squares on browser output.

What am I missing?


In reply to Re^2: Cannot preserve Latin 2 character sets in Perl by PerlPksky
in thread Cannot preserve Latin 2 character sets in Perl by PerlPksky

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.