in reply to Re: Cannot preserve Latin 2 character sets in Perl
in thread Cannot preserve Latin 2 character sets in Perl
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Cannot preserve Latin 2 character sets in Perl
by moritz (Cardinal) on Sep 30, 2011 at 06:48 UTC | |
by PerlPksky (Initiate) on Sep 30, 2011 at 16:14 UTC |