-
September 5th, 2014, 08:40 AM
#16
Re: So how do you compare strings in MFC/Unicode build?
I have found that CRT (and therefore MFC) doesn't directly support locale_invariant, but 1252 close enough (which is what ATL code used before locale_invariant support was added to ATL)
You shouldn't use setlocale(LC_ALL, "") which uses the current language for non Unicode programs and affects more than just character stuff, so you should use this instead:
_tsetlocale(LC_CTYPE, _T(".1252"))
it's as close to what Windows Explorer uses for case insensitive compare as you can get while using the CRT/MFC
sorry to beat a dead horse but this bit me recently so I thought I would post it here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|