Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Bizarre PerlScript/WSH/UTF-8 problem

Reply
Thread Tools

Bizarre PerlScript/WSH/UTF-8 problem

 
 
Guest
Posts: n/a
 
      07-23-2004
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: &#x4e00;</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='&#x0410;&#x0411;&#x0412;'; 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.


--
Dr. Oliver Corff e-mail:
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      07-23-2004
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.

--
Dr. Oliver Corff e-mail:
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      07-30-2004
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: &#x4e00;</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='&#x0410;&#x0411;&#x0412;'; 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.

--
Dr. Oliver Corff e-mail:
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bizarre network application problem Ron Albright Java 7 11-14-2005 10:44 AM
most bizarre problem ever jhcorey@yahoo.com ASP .Net 3 10-24-2005 01:18 PM
Bizarre 2621 Router Problem Frank Durham Cisco 2 03-23-2005 02:52 PM
Bizarre switching problem Matthew Melbourne Cisco 0 10-22-2004 07:25 PM
Bizarre Debugging Problem Elliot M. Rodriguez ASP .Net 1 11-19-2003 02:02 PM



Advertisments