Microsoft KB Archive/175900

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5a, 2.5b, 2.6, 2.6a

-

SYMPTOMS
In development mode, CPCURRENT returns the correct value for a code page setting in the Config.fpw file. At run time, however, CPCURRENT returns a value of zero (0) when the code page setting in the Config.fpw file is set to a value other than 437, 850, or 1252. This behavior also occurs when a run time application is executed on a non-English operating system and the code page is set to auto in the Config.fpw file.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Visual FoxPro 3.x and Visual FoxPro 5.x.

MORE INFORMATION
When Windows starts, the international settings are determined by the values in the [intl] section of the Win.ini file. FoxPro for Windows uses the Microsoft Windows international settings on start up and overrides FoxPro's default settings.

A code page is a character set specific to an operating system or hardware platform. FoxPro uses code page information to translate between code pages so data is properly displayed and ordered. The manner in which data is ordered is determined by the collation sequence invoked with the SET COLLATE TO command. Use of data containing accented characters for any of the supported languages in an index necessitates setting the collation sequence to one of the alternate settings found in the topic SET COLLATE of the FoxPro Help file. Setting the collation sequence to a value other than "MACHINE" requires that "codepage=auto" be included in the Config.fpw file. FoxPro's default collation sequence is "MACHINE" and does not require a code page setting in the Config.fpw file.

For additional information regarding code pages, please see the following articles in the Microsoft Knowledge Base:

"Q103833 Using Alternate Character Sets Provided by Code Pages" "Q129631 Understanding Code Pages in Visual FoxPro" "Q136943 Multiple-Language Implications in Visual FoxPro"

Steps to Reproduce Behavior
 In a clean directory, create a project named CPTEST. Add a new program file named Cptest.prg.  Add the following code to the Cptest.prg file:       *Begin Code testval=CPCURRENT WAIT WINDOW STR(testval) RETURN *End Code  Save the program file and build an executable. In FoxPro 2.x for Windows, copy the support library file (.esl) file to the directory containing the Foxpro executable file.  Create a Config.fpw file in the same directory with the executable, containing one of the following lines:       codepage=620 codepage=737 codepage=852 codepage=861 codepage=865 codepage=866 codepage=895 codepage=857 codepage=1250 codepage=1253 codepage=1254 codepage=10000 codepage=10006 codepage=10007 codepage=10029  Exit FoxPro and run the executable using the Windows Run command.