Microsoft KB Archive/211147

= INFO: Internet Explorer Script Prompts and MBCS/Unicode =

Article ID: 211147

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Internet Explorer 4.0 128-Bit Edition
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 4.01 Service Pack 1
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 5.5
 * Microsoft Windows 98 Standard Edition
 * Microsoft Windows NT 4.0

-



This article was previously published under Q211147



SUMMARY
On systems running English language versions of Windows 95, Windows 98, and Windows NT, certain Microsoft Visual Basic Script (VB Script) and Document Object Model (DOM) procedures for displaying feedback to the user cannot handle the display and input of text in multibyte character systems, such as Japanese and Chinese. These procedures are:
 * Document Object Model: window.alert, window.prompt, and window.confirm methods
 * VBScript MsgBox and InputBox functions

Globalized applications that use these dialogs can create a frustrating experience for the increasingly large number of native non-Western European language speakers working in the United States, Britain, and other countries whose default locale uses non-Western Europen or non-Latin language script.



MORE INFORMATION
Languages using non-Latin scripts are represented on Windows systems in one of two forms: Unicode or non-Unicode (MBCS). Unicode is a single character set representing most of the world's languages; it maps each character in each written language system to a unique number. MBCS standards, such as Shift-JIS for Japanese or Big5 for Chinese, define such mappings for a single language (with ASCII usually included as well for compatibility).

Both Windows NT and Windows 9x platforms support the display of Unicode text within a window using the ExtTextOutW function. Internet Explorer uses this function for all its language display, converting MBCS character encodings to Unicode using the MLang component. Additionally, Internet Explorer hooks into the Input Method Editor (IME), allowing input of non-Latin script into browser forms.

The functions alert, prompt, confirm, MsgBox, and InputBox all ultimately call Win32 functions such as MessageBox, which can only display text for the default system locale. (While functions such as MessageBoxEx and MessageBoxIndirect do allow you to specify a language ID, most non-Western European languages, such as Japanese, are not installed by default on English Windows NT.) Also, because these functions were not designed to interoperate with the Input Method Editor, it is impossible to type non-Latin script into them on English systems.

If you want to create truly global applications, you must leverage Internet Explorer's multilingual capabilities and replace calls to the procedures named earlier with code that opens HTML dialogs using either showModalDialog or showModelessDialog. For an example, see the following Microsoft Knowledge Base article:

244397 BUG: JScript Calling Window.prompt Cannot Handle DBCS Correctly

This problem does not affect localized versions of Windows systems, as long as the specified language is used. In other words, Japanese text displays fine in an alert box on systems running Japanese Windows, and the IME activates for prompt dialogs. Additionally, users of Windows 2000 Multilingual User Interface Edition (MUI) can bypass this problem by installing support for the appropriate language.

