Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems


Developing International Applications

By default, the Sun Chili!Soft ASP Server displays content in United States (US) English and uses US date, time, and currency formats. If you want to deliver ASP applications in locales and languages other than US English, your administrator can change the locale specified for the ASP Server, as described in "Configuring International Support" in "Chapter 3: Managing Sun Chili!Soft ASP." This ensures that the characters in the specified language display properly and that date, time, and currency formats are correct. Ask your administrator which locales are available.

Regardless of the locale for which your server is configured, you can dynamically change how certain content (such as date, time, and currency) is formatted so that it is appropriate for a given locale. You can do this from within an ASP page by changing the value of the Session.LCID property.

The following example shows how to display the current date first in German and then in English, using the Session.LCID property:


Session.LCID = &H0407 ' specify Germany/German

Response.Write FormatDateTime( Date, vbLongDate ) & "<BR>" & vbNewLine

Session.LCID = &H0409 ' specify USA/English

Response.Write FormatDateTime( Date, vbLongDate ) & "<BR>" & vbNewLine


Although you can dynamically change locales via Session.LCID, you can not effectively change code pages in this release of Sun Chili!Soft ASP by using Session.CodePage. This means that any characters that are not supported by the CODEPAGE specified for the ASP Server locale are not reproduced correctly. The major exception to this is characters falling within the normal ASCII range (0x00 to 0x7E), in which the graphical representations are the same in all languages for almost all characters. (The rare exceptions include the 0x5C character, which displays as a backslash in English but as a Yen symbol in Japanese.)

Notes about Japanese character support

Sun Chili!Soft ASP supports only the Shift-JIS encoding of Japanese characters and does not support "extended" or "user-defined" characters. Please note that this applies to all Japanese usage in ASP pages, including literal strings in the source files, text stored to files via the Scripting.FileSystemObject, text stored to databases via the various ADODB objects and methods, and so forth. (The implementation of ADO used with Sun Chili!Soft ASP is called ADODB.) Similarly, all output from ASP to browsers is in Shift-JIS only.

If a field is created as VarChar(nn) or Char(nn) then nn actually represents the number of bytes of data that can be stored in that field. Since the majority of Shift-JIS characters occupy two bytes of memory, fields should be specified with a size that is twice the maximum number of Shift-JIS characters that they need to hold.

Note about DB2 and locale

You must connect to a DB2 database that was created in the same locale in which the Web server and the Sun Chili!Soft ASP Server are running. If you do not, upon attempting to make the database connection from an ASP page, you might receive the following error message:

"There is no available conversion for the source code page "932" to the target code page "1252". Reason Code "1". SQLSTATE=57017"

To address this problem, create and connect to a database that is in the appropriate locale.

See also:
Understanding Code Pages in this chapter.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.