C++ 在Windows Mobile上使用WideChartMultiByte
我有为Win32(XP和更高版本)设计的代码,我正在将其移植到WindowsMobile6。它包含以下行:C++ 在Windows Mobile上使用WideChartMultiByte,c++,unicode,windows-mobile,C++,Unicode,Windows Mobile,我有为Win32(XP和更高版本)设计的代码,我正在将其移植到WindowsMobile6。它包含以下行: int count = ::WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, ..., 0, 0 ); 在Windows XP上,这可以正常工作,但在Windows Mobile上,它返回0,GetLastError()返回错误1004“无效标志”WC\u NO\u BEST\u FIT\u CHARS在Windows Mobile 6
int count = ::WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, ..., 0, 0 );
在Windows XP上,这可以正常工作,但在Windows Mobile上,它返回0,GetLastError()返回错误1004“无效标志”WC\u NO\u BEST\u FIT\u CHARS
在Windows Mobile 6 SDK的winnls.h中定义
如果我将调用替换为::wcstombs
或将WC\u NO\u BEST\u FIT\u CHARS
替换为0,则此代码将在有限的测试中有效
我想知道做出这两个改变的后果是什么。如果我在中文版或俄文版的Windows Mobile上运行我的程序,这仍然有效吗 Windows Mobile基于Windows CE,根据文档 根据该页面,支持的标志包括: WC_COMPOSITECHECK Convert composite characters to precomposed characters. WC_DISCARDNS Discard nonspacing characters during conversion. WC_SEPCHARS Generate separate characters during conversion. (This is the default conversion behavior). WC_DEFAULTCHAR Replace exceptions with the default character during conversion. WC_COMPOSITECHECK将合成字符转换为预合成字符。 WC_DISCARDNS在转换过程中丢弃非空格字符。 WC_SEPCHARS在转换期间生成单独的字符。 (这是默认的转换行为)。 WC_DEFAULTCHAR在转换期间用默认字符替换异常。