FIX: Code Pages Not Supported in All OS Languages at Run Time

Last reviewed: November 11, 1997
Article ID: Q175900
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:

   ARTICLE-ID: Q103833
   TITLE     : Using Alternate Character Sets Provided by Code Pages

   ARTICLE-ID: Q129631
   TITLE     : Understanding Code Pages in Visual FoxPro

   ARTICLE-ID: Q136943
   TITLE     : Multiple-Language Implications in Visual FoxPro

Steps to Reproduce Behavior

  1. In a clean directory, create a project named CPTEST.

  2. Add a new program file named Cptest.prg.

  3. Add the following code to the Cptest.prg file:

          *Begin Code
          testval=CPCURRENT()
          WAIT WINDOW STR(testval)
          RETURN
          *End Code
    

  4. 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.

  5. 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
    

  6. Exit FoxPro and run the executable using the Windows Run command.

REFERENCES

FoxPro Help file; search on topic: "code pages" FoxPro Help file; search on topic: "SET COLLATE"


Additional query words:
Keywords : FoxWin FxenvOs FxsetupGeneral
Version : WINDOWS:2.5a,2.5b,2.6,2.6a
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.