Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Script Encoder Does Not Decode Properly When Locale Changes


View products that this article applies to.

This article was previously published under Q298790

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


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:

↑ Back to the top


Keywords: kbbug, kblocalization, kbpending, kbscript, KB298790

↑ Back to the top

Article Info
Article ID : 298790
Revision : 4
Created on : 5/11/2006
Published on : 5/11/2006
Exists online : False
Views : 454