如何使UNI code字小写字母

编程入门 行业动态 更新时间:2024-10-27 22:21:02
本文介绍了如何使UNI code字小写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在转换为降低一个CString Variable.so,英语MakeLower(在VC ++ MFC。我UNI code字符字母都UNI code字问题)工作正常,我也得到小写。但它不能转换UNI code字来降低case.I曾尝试STL的算法转换:

I have problem in converting to lower case letters for unicode characters in VC++ MFC .I have unicode characters in a CString Variable.so,with English MakeLower() works fine and I get lower case .But it cannot convert unicode characters to lower case.I did try the STL algorithm transform :

的std ::字符串数据=ИИИЛЛЛЛ; // bulgerian字符

std::string data = "ИИИЛЛЛЛ"; //bulgerian chars

的std ::变换(data.begin(),data.end(),data.begin(),tolower的::);

std::transform(data.begin(), data.end(), data.begin(), ::tolower);

但它无法加载UNI code字符,我得到????符号到位UNI code字符的。

but it fails to load the unicode chars ,I get "????" symbols in place of unicode chars .

能否请您让我知道如果有一个单向code字符。我不喜欢提前使用boost libraries.Thanks的解决方案!

Can you please let me know if there is a solution for unicode chars .I dont like to use boost libraries.Thanks in advance!

推荐答案

如果您的项目使用的统一code字符集(项目属性), CString的:: MakeLower()应该努力 - 注意,这将不转换字符串的内容,它返回一个新字符串,请参阅的这个MSDN文章:

If your project uses the Unicode Character Set (project properties), CString::MakeLower() should work -- note that this will not convert the contents of the string, it returns a new string, see this MSDN article:

CString s1(_T("ABC")), s2; s2 = s1.MakeLower(); ASSERT(s2 == _T("abc"));

修改:CString的:: MakeLower()不会改变字符串的contentrs,它也返回到转换后的字符串的引用

EDIT: CString::MakeLower() does change the contentrs of the string, it also returns a reference to the converted string

更多推荐

如何使UNI code字小写字母

本文发布于:2023-10-16 17:06:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498197.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字母   UNI   code

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!