BUG: Script Encoder Does Not Decode Properly When Locale Changes (298790)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 4.0
  • Microsoft Internet Explorer (Programming) 4.01
  • Microsoft Internet Explorer (Programming) 4.01 SP1
  • Microsoft Internet Explorer (Programming) 4.01 SP2
  • Microsoft Internet Explorer (Programming) 5
  • Microsoft Internet Explorer (Programming) 5.01
  • Microsoft Internet Explorer (Programming) 5.01 SP1
  • Microsoft Internet Explorer (Programming) 5.5
  • Microsoft Internet Explorer (Programming) 5.5 SP1
  • Microsoft Internet Explorer (Programming) 5.5 SP2
  • Microsoft Internet Explorer (Programming) 6.0
  • Microsoft Internet Explorer (Programming) 6 (SP1)

This article was previously published under Q298790

SYMPTOMS

When script is encoded on a computer from one locale and then decoded on a computer from a different locale, the decoding can produce unexpected results.

CAUSE

The encoding only affects the ASCII range of characters (0-127) and does not change the characters outside of this range. Specifically, this problem occurs when you transition between English and Asian languages because a non-ASCII character in English may be the leading character of a multibyte sequence in an Asian language. This can cause ambiguous results.

RESOLUTION

To work around this problem, use one of the following methods:
  1. Load the HTML/ASP file in Notepad. Save the file in Unicode format instead of the default ANSI format. To do this, click Unicode in the Encoding drop-down list box at the bottom of the Save As dialog box).
  2. Locate scripts on the server so that the client only refers to these scripts, and no encoding is present.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new HTML document with the following line in a script tag:

    "!#$%&'()-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz"...''""{}~--(tm) (c)"(r)"1/43/41/2"

  2. In Windows Script Encoder, type the following command in an English Windows-based system to encode the HTML document that contains the preceding line:

    screnc Test.htm encodedTest.htm

  3. In Internet Explorer, try to load the encoded script file on a computer that is set to use an Asian language (for example, Japanese, Chinese, or Korean).

    Although you do not receive an error message from the code as expected, you receive an error message on the Asian language computer (which appears in the particular language):
    Line 1, Character 1. Expected statement 800a0400 Source Microsoft VB script compilation error.

REFERENCES

Script Encoding with the Microsoft Script Engine Version 5.0

For more information about script encoding, see the following MSDN Web site: For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbbug kbLocalization kbpending kbScript KB298790