Entering International Data

An important aspect of developing international applications is knowing how to enter data into your application. Data can come into your application in two ways:

  • Users enter the data.
  • You or your users import the data from existing files.

The following sections discuss these two methods.

Entering International Characters

You can enter international characters into Visual FoxPro using your keyboard. The exact method you use depends on the language you're working with. In single-byte character environments, you can enter the characters directly, or by pressing a combination of keys on the keyboard. On the other hand, double-byte character set (DBCS) environments often provide an Input Method Editor (IME), which is an application you can use to enter characters.

Entering Characters Using the Keyboard

With an international keyboard you can display international characters by simply pressing the keys dedicated to those characters. If your keyboard doesn't have keys for international characters, you can enter such characters by using the character map provided with Windows or by pressing the ALT key in conjunction with keys on the numeric keypad.

The easiest way to enter an international character is to copy it from the character map, which is available from the Accessories menu.

Alternatively, you can enter an international character by pressing ALT combined with a four-digit number beginning with zero that you enter from the numeric keypad.

Note   You cannot enter international characters in FoxFont. For example, if you open the Command window, switch to FoxFont, and then press a dedicated key, the result isn't the character on the key. For best results, avoid FoxFont in international applications.

To create an international character

  • Copy the character from the character map, and then paste it into your document.

    -or-

  • Hold down ALT and then type a zero followed by the appropriate three-digit ASCII code.

    Tip   The status bar on the character map shows the key combination that corresponds to each character selected on the map.

For instance, to type ö (ANSI code 246), press NUM LOCK on the numeric keypad, and then press ALT+0246. Be sure to use a standard Windows font — not FoxFont or FoxPrint.

Troubleshooting

If characters don't transport correctly, see if you're using FoxFont. For example, FoxFont is the default for user-defined windows created with DEFINE WINDOW (if the FONT clause is omitted). Be sure to use the FONT clause to specify a font other than the standard Windows font when creating user-defined windows so that international characters display correctly.

Entering Characters Using an IME

If you're working in an IME environment, you can use an Input Method Editor to enter characters into Visual FoxPro. The IME is an application provided with your environment that makes it possible for you to type characters on the keyboard to display a selection of international characters and then choose the specific character you want. For example, an IME for Chinese might make it possible for you to enter a Pinyin representation of a Chinese word and then display a list of characters that match the representation. When you select the character you want, the IME pastes it into Visual FoxPro.

You can control when Visual FoxPro displays an IME by setting the IMEMode property or calling the IMESTATUS( ) function. If you turn the IME window on, Visual FoxPro automatically displays the IME when you're editing in a system window such as the Browse or Edit windows. If you turn the IME window off, you can invoke the IME by pressing the appropriate keys on your keyboard.

Appending and Copying International Data

If you're importing or copying data from delimited files using the APPEND FROM or COPY TO commands, you can specify what character is being used in the file to separate fields. For example, it's common in many European countries to use a semicolon (;) as a field delimiter, whereas the common delimiters in the United States are comma (,), tab, or space.

To import or copy files and specify a delimiter, add the DELIMITED WITH CHARACTER clause to the APPEND FROM or COPY TO commands:

COPY TO mytxt.txt DELIMITED WITH _ WITH CHARACTER ";"

See Also

Design of the Interface | Code Pages in Visual FoxPro | Developing International Applications | DEFINE WINDOW | Code Pages Supported by Visual FoxPro