MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / localeIsUtf8

Function localeIsUtf8

src/twtest/charutil_t.cpp:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45#include <algorithm>
46
47bool 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
61void CheckChars(const TSTRING& str, int length_expected = 1)
62{

Callers 1

TestCharUtilBasicFunction · 0.85

Calls 3

beginMethod · 0.80
endMethod · 0.80
findMethod · 0.45

Tested by 1

TestCharUtilBasicFunction · 0.68