String To Lower/Upper in C++

前端 未结 10 1958
挽巷
挽巷 2020-12-08 20:10

What is the best way people have found to do String to Lower case / Upper case in C++?

The issue is complicated by the fact that C++ isn\'t an English only programmi

10条回答
  •  心在旅途
    2020-12-08 20:41

    I have found a way to convert the case of unicode (and multilingual) characters, but you need to know/find (somehow) the locale of the character:

    #include 
    
    _locale_t locale = _create_locale(LC_CTYPE, "Greek");
    AfxMessageBox((CString)""+(TCHAR)_totupper_l(_T('α'), locale));
    _free_locale(locale);
    

    I haven't found a way to do that yet... I someone knows how, let me know.

    Setting locale to NULL doesn't work...

提交回复
热议问题