SetFileApisToOEM  YDAXO_ 

The SetFileApisToOEM function causes a set of Win32 file functions to use the OEM character set code page. This function is useful for 8-bit console input and output operations.

VOID SetFileApisToOEM(VOID)
 

Parameters

This function has no parameters.

Return Values

This function has no return value.

Remarks

The SetFileApisToOEM function is complemented by the SetFileApisToANSI1.20FA function, which causes the same set of Win32 file functions to use the ANSI character set code page.

The 8-bit console functions use the OEM code page by default. All other functions use the ANSI code page by default. This means that strings returned by the console functions may not be processed correctly by other functions, and vice versa. For example, if the FindFirstFileA2A0Z0Q6 function returns a string that contains certain extended ANSI characters, and the 8-bit console functions are set to use the OEM code page, then the WriteConsoleA5_0W_R1 function will not display the string properly.

Use the AreFileApisANSI2N249.N function to determine which code page the set of file functions is currently using. Use the SetConsoleCP4LXO_MT and SetConsoleOutputCP.PZ.AU functions to set the code page for the 8-bit console functions.

To solve the problem of code page incompatibility, it is best to use Unicode for console applications. Console applications that use Unicode are much more versatile than those that use 8-bit console functions. Barring that solution, a console application can call the SetFileApisToOEM function to cause the set of Win32 file functions to use OEM character set strings rather than ANSI character set strings. Use the SetFileApisToANSI function to set those functions back to the ANSI code page.

SetFileApisToANSI and SetFileApisToOEM affect these Win32 functions:

_lopen94KIQD

GetDriveType1VIS91.

LoadLibrary1VGHBF8

CopyFileAL5GU.

GetFileAttributes3PQDMO

LoadLibraryExLYQYTX

CreateDirectoryF6ND8

GetFullPathName8N6HYC

MoveFile1S180VE

CreateFileXN35YD

GetModuleFileName3OO70X8

MoveFileEx5N2WFG

CreateProcess5FBJ_XX

GetModuleHandle18VFC_P

OpenFile47XK05

DeleteFile.H9HCZ

GetSystemDirectory3OJ42SV

RemoveDirectory9I2C9V

FindFirstFile2A0Z0Q6

GetTempFileNameXPKIP

SearchPath1FBA0SQ

FindNextFileJKCUCC

GetTempPathLZZS8Y

SetCurrentDirectoryHWNGHC

GetCurrentDirectoryLWY0BA

GetVolumeInformationCJNVCW

SetFileAttributesHA1.I7

GetDiskFreeSpace3028BBK

GetWindowsDirectory1B6TYCN

 

 

When dealing with command lines, a console application should obtain the command line in Unicode form, and then convert it to OEM form using the relevant character-to-OEM functions. Note also that the argv function uses the ANSI character set.

See Also

AreFileApisANSI, FindFirstFileA, SetConsoleCP, SetConsoleCP, SetConsoleOutputCP, SetFileApisToANSI, WriteConsoleA