[fpc-pascal]Special characters II

Michael Van Canneyt michael at wisa.be
Fri Mar 22 22:45:09 CET 2002


On Wed, 20 Mar 2002, Bernhard Steffen wrote:

> [...]
> > Codepages 437 and 850 are the DOS characters used in a command-shell
> > window.  Codepage ISO-8859-1 is the Windows character set used in
> > Windows GUI applications.  You can get into trouble if you use a
> > Windows GUI editor for source code for applications that will run
> > in a command-shell window, or vice versa.
> [...]
> 
> I have a problem which seems to be related to this:
> 
> - I'm listing the directory (FindFirst/FindNext), doing something
>   to the files and displaying the filename
> 
> - certain file names (those with special characters in it, like umlauts
>   etc.) get displayed wrong (scrambled characters) - I guess this is
>   due to codepage differences between GUI & console mode
> 
> - sometimes, I can't even access those files (assign/reset), using the
>   filenames I got from FindFirst/FindNext
>   (no network / no files locked)
> 
> Although this is mostly a cosmetic bug, is there a way to fix it, like
> changing the codepage from within the program (no user interaction /
> configuration required)?

Try using the CharToOEM function from the Windows unit.
This will convert a windows string to a format
suitable for the console display.

This will of course not work from a go32v2 program, only from native Win32
programs.


Michael.





More information about the fpc-pascal mailing list