网站首页  词典首页

请输入您要查询的函数:

 

术语 setfileapistooem
释义 SetFileApisToOEM
语法:
C++
void WINAPI SetFileApisToOEM(void);
SetFileApisToOEM功能
导致文件的I / O功能的过程中使用的字符集的OEM代码页。此功能可用于8位控制台输入和输出操作。
参数
这个函数没有参数。
返回值
这个函数没有返回值。
备注
该文件I / O功能的代码页是由SetFileApisToOEM成立由KERNEL32.DLL的出口,接受或返回一个文件名的功能。 SetFileApisToOEM设置每个进程的代码页,而不是每个线程或每台计算机。
该SetFileApisToOEM功能是补充了SetFileApisToANSI功能,这会导致文件I / O功能使用同一套ANSI字符集的代码页。
8位游戏机功能,默认情况下使用OEM代码页。所有其他功能默认使用ANSI代码页。这意味着字符串的控制台函数可能无法处理其他正常运行,反之亦然返回手段。例如,如果FindFirstFileA函数返回一个字符串,包含某些扩展的ANSI字符,而8位游戏机功能设置为使用OEM代码页,然后WriteConsoleA功能将不显示正确的字符串。
使用AreFileApisANSI功能,以确定哪些代码页的文件设置/ O功能正在使用。使用SetConsoleCP和SetConsoleOutputCP功能设置为8位游戏机功能的代码页。
为了解决代码页不兼容的问题,最好的方法是使用Unicode的控制台应用程序。控制台应用程序使用Unicode远比那些使用8位游戏机功能,用途广泛。除了上述的解决方案,一个控制台应用程序可以调用SetFileApisToOEM函数造成的文件I / O功能,使用OEM字符集的字符串,而不是ANSI字符集字符串。使用SetFileApisToANSI函数来设置这些功能回到ANSI代码页。
在处理命令行,控制台应用程序应该向在Unicode形式的命令行,然后将其转换为OEM方式使用有关的字符到的OEM功能。还注意到,在该命令argv参数数组行的主要功能包含ANSI字符集,在这种情况下,字符串。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
AreFileApisANSI
文件管理函数
FindFirstFileA
SetConsoleCP
SetConsoleCP
SetConsoleOutputCP
SetFileApisToANSI
WriteConsoleA
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==SetFileApisToOEM Function
Causes the file I/O functions for the process to use the OEM character set code page. This function is useful for 8-bit console input and output operations.
Syntax
C++
void WINAPI SetFileApisToOEM(void);
Parameters
This function has no parameters.
Return Value
This function has no return value.
Remarks
The file I/O functions whose code page is set by SetFileApisToOEM are those functions exported by KERNEL32.DLL that accept or return a file name. SetFileApisToOEM sets the code page per process, rather than per thread or per computer.
The SetFileApisToOEM function is complemented by the SetFileApisToANSI function, which causes the same set of file I/O 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 FindFirstFileA 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 WriteConsoleA function will not display the string properly.
Use the AreFileApisANSI function to determine which code page the set of file I/O functions is currently using. Use the SetConsoleCP and SetConsoleOutputCP 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 file I/O 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.
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 array in the argv parameter of the command-line main function contains ANSI character set strings in this case.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
AreFileApisANSI
File Management Functions
FindFirstFileA
SetConsoleCP
SetConsoleCP
SetConsoleOutputCP
SetFileApisToANSI
WriteConsoleA
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365534(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:15:19