This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Character sets in win32 and cygwin
- To: schilling at fokus dot gmd dot de
- Subject: Re: Character sets in win32 and cygwin
- From: DJ Delorie <dj at delorie dot com>
- Date: Tue, 7 Mar 2000 15:32:35 -0500
- CC: cygwin-developers at sourceware dot cygnus dot com
- References: <200003072022.VAA25434@fokus.gmd.de>
> The best long-term solution for a console application is to use
> Unicode. Barring that solution, a console application should use the
> SetFileApisToOEM function. That function changes relevant Win32 file
> functions so that they produce OEM character set strings rather than
> ANSI character set strings. "
You mean like this?
/* If we didn't call SetFileApisToOEM, console I/O calls would use a
different codepage than other Win32 API calls. In some languages
(not English), this would result in "cat > filename" creating a file
by a different name than if CreateFile was used to create filename.
SetFileApisToOEM prevents this problem by making all calls use the
OEM codepage. */
SetFileApisToOEM ();