Win32 API中的`A`和`W`函数之间有什么区别? [英] What is the difference between the `A` and `W` functions in the Win32 API?

查看:303
本文介绍了Win32 API中的`A`和`W`函数之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调用Win32 API函数时,将A字符附加到末尾而不是W字符有什么区别.

我知道它的意思是ASCIIWIDE CHARACTER或Unicode,但是输出或输入有什么区别?

例如,如果我调用GetDefaultCommConfigA,它将用ASCII字符串而不是WCHAR字符串填充我的COMMCONFIG结构吗? (或者对于GetDefaultCommConfigW反之亦然)

换句话说,我怎么知道字符串编码是ASCII还是UNICODE,必须是我调用的函数AW的版本吗?正确吗?

我发现了这个问题,但我认为它不回答我的问题.

解决方案

A函数使用Ansi(非ASCII)字符串作为输入和输出,而W函数使用Unicode字符串代替(NT4上的UCS-2和更早版本,即W2K及更高版本上的UTF-16). 有关详细信息,请参阅MSDN .

What is the difference in calling the Win32 API function that have an A character appended to the end as opposed to the W character.

I know it means ASCII and WIDE CHARACTER or Unicode, but what is the difference in the output or the input?

For example, If I call GetDefaultCommConfigA, will it fill my COMMCONFIG structure with ASCII strings instead of WCHAR strings? (Or vice-versa for GetDefaultCommConfigW)

In other words, how do I know what Encoding the string is in, ASCII or UNICODE, it must be by the version of the function I call A or W? Correct?

I have found this question, but I don't think it answers my question.

解决方案

The A functions use Ansi (not ASCII) strings as input and output, and the W functions use Unicode string instead (UCS-2 on NT4 and earlier, UTF-16 on W2K and later). Refer to MSDN for more details.

这篇关于Win32 API中的`A`和`W`函数之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆