AreFileApisANSI function (fileapi.h)

Determines whether the file I/O functions are using the ANSI or OEM character set code page. This function is useful for 8-bit console input and output operations.


BOOL AreFileApisANSI();

Return value

If the set of file I/O functions is using the ANSI code page, the return value is nonzero.

If the set of file I/O functions is using the OEM code page, the return value is zero.


The SetFileApisToOEM function causes a set of file I/O functions to use the OEM code page. The SetFileApisToANSI function causes the same set of file I/O functions to use the ANSI code page. Use the AreFileApisANSI function to determine which code page the set of file I/O functions is currently using. For a discussion of these functions' usage, please see the Remarks sections of SetFileApisToOEM and SetFileApisToANSI.

The file I/O functions whose code page is ascertained by AreFileApisANSI are those functions exported by KERNEL32.DLL that accept or return a file name.

The functions SetFileApisToOEM and SetFileApisToANSI set the code page for a process, so AreFileApisANSI returns a value indicating the code page of an entire process.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol Yes
SMB 3.0 Transparent Failover (TFO) Yes
SMB 3.0 with Scale-out File Shares (SO) Yes
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes


Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header fileapi.h (include Windows.h, WinBase.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

File Management Functions