This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Character sets in win32 and cygwin



> 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 ();

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]