Share via


Application Creation with Double-Byte Character Sets

Visual FoxPro supports DBCS (double-byte character sets) — character sets that require more than one byte to represent a character. Some examples of languages that require a double-byte character set are Simplified Chinese, Traditional Chinese, and Korean.

Visual FoxPro DBCS support makes it possible for you to create international applications. For example, you can create a Korean application with a U.S. version of Visual FoxPro if you're running the Korean version of Windows. The Visual FoxPro DBCS functions operate properly on the Korean character set, and the Korean collation sequence is supported.

Note   Visual FoxPro provides special programming functions for use with string in DBCS environments.

Using DBCS Characters When Naming Objects

Visual FoxPro makes it possible for you to use DBCS characters when naming elements of your applications. As with Visual FoxPro generally, elements can:

  • Be up to 254 characters in length with the combination of double-byte characters and single characters. For example, if you use all double-byte characters, the name you're creating can be only 127 characters long.
  • Begin with a letter, number, underscore or leading-trailing byte combination.
  • Contain only letters, numbers, underscores, or DBCS characters.

These rules apply to variables, objects (windows, menus, and so on), function and procedure names, class and subclass names, aliases, and constants. You can also use double-byte characters for file names. To avoid the possibility that characters in the file name are inadvertently treated as delimiters, it's safest to always enclose the file name in quotation marks.

Note   Visual FoxPro length limits are expressed using single-byte characters. Using double-byte characters in field names, index expressions, variable names, window names, and so on, effectively shortens the length of the name. For example, a field name can be up to 10 bytes long in a free table, so a field name can consist of 10 single-byte characters, but only 5 double-byte characters. For more information about Visual FoxPro system capacities, see System Capacities.

Sorting DBCS Data

To help you order information in DBCS environments, Visual FoxPro supports collation sequences for Simplified Chinese, Traditional Chinese, Japanese, and Korean. Collation sequences make it possible for you to properly order character fields in tables for each language.

The following table lists the Visual FoxPro collation sequence options and the corresponding language.

Options Language
JAPANESE Japanese
KOREAN Korean
PINYIN Simplified Chinese
STROKE Simplified and Traditional Chinese

For more information about specifying collation sequences, see Specifying Sort Orders.

See Also

Sorting Data in International Applications | Creating or Modifying Programs | Developing International Applications | Code Pages Supported by Visual FoxPro | Code Pages in Visual FoxPro |