是否有Unicode替代OutputDebugString? [英] Is there a Unicode alternative to OutputDebugString?

查看:153
本文介绍了是否有Unicode替代OutputDebugString?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OutputDebugString()是本机ASCII,这意味着它将在调用ASCII版本OutputDebugStringA()之前将输入的Unicode字符串转换为本地字符串.

OutputDebugString() is native ASCII, which means it convert the input Unicode string to local string before call the ASCII version OutputDebugStringA().

OutputDebugString()是否支持Unicode?

Is there any alternative to OutputDebugString() which supports Unicode?

推荐答案

OutputDebugStringW在内部调用OutputDebugStringA,因此无法在系统代码页中表示的Unicode字符将替换为?.

OutputDebugStringW does internally call OutputDebugStringA, so Unicode characters that cannot be represented in the system code page will be replaced with ?.

奇怪的是,调试器从操作系统接收到的用于打印消息的OUTPUT_DEBUG_STRING_INFO 结构似乎确实支持让调试器知道字符串是否为Unicode,它似乎根本没有被OutputDebugStringW使用.

Oddly enough, the OUTPUT_DEBUG_STRING_INFO structure the debugger receives from the operating system to print the message does appear to support letting the debugger know if the string is Unicode, it just doesn't appear to be used by OutputDebugStringW at all.

不幸的是,我不知道使操作系统引发

Unfortunately, I don't know of a mechanism to get the OS to raise a OUTPUT_DEBUG_STRING_EVENT with a Unicode string. It may not be possible with public APIs.

这篇关于是否有Unicode替代OutputDebugString?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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