| 45 | #include <algorithm> |
| 46 | |
| 47 | bool localeIsUtf8() |
| 48 | { |
| 49 | std::string locale(setlocale(LC_CTYPE, 0)); |
| 50 | std::transform(locale.begin(), locale.end(), locale.begin(), ::tolower); |
| 51 | |
| 52 | if (locale.find("utf-8") != std::string::npos) |
| 53 | return true; |
| 54 | |
| 55 | if (locale.find("utf8") != std::string::npos) |
| 56 | return true; |
| 57 | |
| 58 | return false; |
| 59 | } |
| 60 | |
| 61 | void CheckChars(const TSTRING& str, int length_expected = 1) |
| 62 | { |