The information in this article applies to:
SUMMARY
This article discusses Code Pages in Visual FoxPro and covers the following
topics:
MORE INFORMATIONDescription of a Code PageA code page is a set of characters specific to a language or hardware platform. In Visual FoxPro, a code page is a table of characters and corresponding numbers in memory that Visual FoxPro uses to display data properly.Some characters available in one code page are not available in another, and accented characters are not represented by the same values across platforms and code pages. How Visual FoxPro Uses Code PagesWhen you create a file with a table file structure, Visual FoxPro automatically gives it a code page mark, indicating which code page the file uses. For example, if you enter the letter C in a .DBF file, the letter is stored on your hard disk as the number 67. When you open the file, Visual FoxPro determines its code page, inspects the code page to find the character corresponding to the number 67, and then displays the character (C) on your monitor.Using Code Pages in the Development EnvironmentVisual FoxPro supports many code pages and each code page contains characters unique to certain locales. If you want to create an application for a specific locale, you must create the application's components using the code page designed for that locale and environment. For example, to create an application for use in Russia, you should use code page 1251, 866, or 10007 for users in the Windows, MS-DOS, or Macintosh environments, respectively.TIP: To create successive files with the same code page, first specify the code page by setting the CODEPAGE parameter in the CONFIG.FPW file. Then restart Visual FoxPro before creating the files. Checking for Code Page Marks in .DBF FilesYou can determine whether a .DBF file has a code page mark by using the CPDBF() function after opening the file or by having Visual FoxPro check when you open the file. To check for code page marks automatically:
Entering Code Page Characters Not Represented by Keys on the KeyboardIf you need to enter characters not represented by keys on your keyboard, you must enter these characters using the ALT key in conjunction with keys on the numeric keypad. However, remember that the same key combination in different environments often displays different results. For example, if you enter ALT+0182 with code page 1252 in Visual FoxPro, you see a paragraph symbol. In contrast, if you enter ALT+0182 with code page 437 in FoxPro for MS-DOS, you see a graphic character with a double vertical line meeting a single horizontal line.Using Code Pages from Earlier Versions of FoxProIf you use a file from an earlier version of FoxPro, the file might not have a code page mark. If the mark is missing when you open the file, Visual FoxPro prompts you for a code page and then marks the file with it. However, if the code page is incorrect, some characters in the file might not display properly. If this happens, remove the code page mark, and then add the appropriate mark.TIP: Instead of setting the Prompt for Code Page check box, you can use the SET CPDIALOG command to check for code pages. Code Pages Supported by Visual FoxProAlthough Visual FoxPro supports many code pages, only a few are used often. With Visual FoxPro, for example, English-speaking users typically use code page 1252. However, with Visual FoxPro for MS-DOS, English-speaking users typically use code page 437. The following table shows the code pages supported in Visual FoxPro for each platform, and the corresponding code page identifier.
NOTE: (1) This code page is not detected when you include CODEPAGE=AUTO in
your configuration file.
REFERENCESFor more information about code pages, please see the "Understanding Code Pages" topic in the Visual FoxPro Help menu. Additional query words: VFoxWin
Keywords : kbenv FxenvOptimize |
Last Reviewed: August 11, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |