Bizarre PerlScript/WSH/UTF-8 problem

Discussion in 'Perl Misc' started by Guest, Jul 23, 2004.

  1. Guest

    Guest 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.


    --
    Dr. Oliver Corff e-mail: -berlin.de
     
    Guest, Jul 23, 2004
    #1
    1. Advertising

  2. Guest

    Guest Guest

    -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.

    --
    Dr. Oliver Corff e-mail: -berlin.de
     
    Guest, Jul 23, 2004
    #2
    1. Advertising

  3. Guest

    Guest Guest

    -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.

    --
    Dr. Oliver Corff e-mail: -berlin.de
     
    Guest, Jul 30, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Benjamin Bittner

    IISFAQ WSH Script in/to DotNet

    Benjamin Bittner, Jun 28, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    875
    M. Zeeshan Mustafa
    Jun 28, 2004
  2. David Josty

    wsh and Python

    David Josty, Apr 9, 2005, in forum: Python
    Replies:
    1
    Views:
    470
    Roger Upole
    Apr 10, 2005
  3. Guest
    Replies:
    6
    Views:
    149
    Joe Smith
    Jul 25, 2004
  4. Smugsboy

    PerlScript (WSH) - Cannot set property

    Smugsboy, Mar 16, 2005, in forum: Perl Misc
    Replies:
    4
    Views:
    126
    Smugsboy
    Mar 17, 2005
  5. Les
    Replies:
    2
    Views:
    105
Loading...

Share This Page