Bizarre PerlScript/WSH/UTF-8 problem

G

Guest

Hi All,

I try to put utf8 material into a browser page via a Perl script
embedded in an HTML page. The whole thing runs under Windows XP
Professional, I am using ActivePerl 5.8.0 and IE 6.0. A minimal
file exhibiting the problem is given here:

<HTML>
<HEAD>
<TITLE>PerlScript Minimal Test</TITLE>
</HEAD>
<BODY>
<H2>A Chinese Character: 一</H2><!-- test, works well -->
<SCRIPT LANGUAGE="PerlScript">
use utf8; # Doesn't seem to make any difference here
#
$abwwide="\x{0410}\x{0411}\x{0412}" # Cyrillic ABW
$window->document->write($abwwide); # Doesn't work
#
$abw ="ÐБВ" # Again Cyrillic ABW, but in utf8
$window->document->write($abw); # Doesn't work
#
# Direct approach
$window->document->write("ÐБВ"); # doesn't work, either
#
$htmlified_char='АБВ'; The same, ABW
$window->document->write($htmlified_char); # works!
</SCRIPT>
</BODY>
</HTML>

I think I've browsed the complete documentation of AS Perl as far
as it is at least remotely related to either Unicode or WSH; I've
been writing Perl code for Linux which successfully digests thousands
of lines of utf8-encoded text in the wildest array of languages
(e.g., Mongolian, Arabic, Chinese, Tibetan all in one document)
and it works. However I fail to understand where to search for a
solution to the above-mentioned problem.

Thanks for any hints,

Oliver.
 
G

Guest

(e-mail address removed)-berlin.de wrote:
: Hi All,

: I try to put utf8 material into a browser page via a Perl script
: embedded in an HTML page. The whole thing runs under Windows XP
: Professional, I am using ActivePerl 5.8.0 and IE 6.0. A minimal
: file exhibiting the problem is given here:


Of course I tried various settings of "View -> Encoding", and I tried
to set these as <META ...> statements, but this did not remove any
obstacle.


Oliver.
 
G

Guest

(e-mail address removed)-berlin.de wrote:

With regard to the code below, I plead guilty for writing: "Doesn't work".
What I wanted to say instead is that the browser displays weird garbage
or question marks but not the desired output.

: Hi All,

: I try to put utf8 material into a browser page via a Perl script
: embedded in an HTML page. The whole thing runs under Windows XP
: Professional, I am using ActivePerl 5.8.0 and IE 6.0. A minimal
: file exhibiting the problem is given here:

: <HTML>
: <HEAD>
: <TITLE>PerlScript Minimal Test</TITLE>
: </HEAD>
: <BODY>
: <H2>A Chinese Character: 一</H2><!-- test, works well -->
: <SCRIPT LANGUAGE="PerlScript">
: use utf8; # Doesn't seem to make any difference here
: #
: $abwwide="\x{0410}\x{0411}\x{0412}" # Cyrillic ABW
: $window->document->write($abwwide); # Doesn't work
: #
: $abw ="Ð?Ð?Ð?" # Again Cyrillic ABW, but in utf8
: $window->document->write($abw); # Doesn't work
: #
: # Direct approach
: $window->document->write("Ð?Ð?Ð?"); # doesn't work, either
: #
: $htmlified_char='АБВ'; The same, ABW
: $window->document->write($htmlified_char); # works!
: </SCRIPT>
: </BODY>
: </HTML>

If anybody feels that this is not a perl-related question which is better
dealt with in a different newsgroup, I'll be happy to receive and follow
suggestions where to look/write.

Thanks,

Oliver.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top