[Webkit-unassigned] [Bug 9090] New: Upper character codes disappear from variables in JavaScript if defined in JavaScript that includes HTML comment format to hide script

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Wed May 24 07:59:58 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9090

           Summary: Upper character codes disappear from variables in
                    JavaScript if defined in JavaScript that includes HTML
                    comment format to hide script
           Product: WebKit
           Version: 417.x
          Platform: Macintosh PowerPC
               URL: http://www.wilcoxusa.net/superansi_comment_test_case.htm
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: dwilcox at kronos.com


When I define a JavaScript string that has superANSI characters in it, such as
in the following case, those chacters either disappear or are encoded
incorrectly if the JavaScript block they are in uses the HTML comment to "hide"
the script from nonsupporting browsers.

I've written a test case HTML to demonstrate the problem and workaround.

So the following will work correctly:

<script type="text/javascript">
        var testValueNoComment = "€mudlarkŠ"
</script>

But this version (note the comment code on the lines that have the <script>
tags), does not:

<script type="text/javascript"><!--
        var testValueNoComment = "€mudlarkŠ"
// --></script>

In the "not working" test case, displaying the string using an alert, utilizing
a form value, etc., removes the upper-level characters from the string.

Strangely, although unescaping the same strings show that the characters are
there, they will get hex encoded versus unicode encoded (%80 for Euro v.
%u20AC).

We discovered this problem when we transferred strings from Java (in JSPs) that
contain such characters.

This does not occur on our way-back test platform running OS X 10.3.8 and
Safari 1.2.4 (v125.12), but does occur on our OS X 10.3.9 / Safari 1.3.2
(v312.6) and 10.4.6 / Safari 2.0.3 (417.9.3) platforms.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list