| delorie.com/archives/browse.cgi | search |
> 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 ();
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |