mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-30 19:24:23 +01:00
Add UTF8StringNonASCIICount
This commit is contained in:
1 parent
e0d107ad20
commit
7f18e1faab
2 files changed
+10
-3
No files matched your search
+8
-3
@@ -394,12 +394,17 @@ int u8_is_locale_utf8(const char *locale)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool UTF8StringHasNonASCII(const char *utf8string) {
|
||||
int UTF8StringNonASCIICount(const char *utf8string) {
|
||||
UTF8 utf(utf8string);
|
||||
int count = 0;
|
||||
while (!utf.end()) {
|
||||
int c = utf.next();
|
||||
if (c > 127)
|
||||
return true;
|
||||
++count;
|
||||
}
|
||||
return false;
|
||||
return count;
|
||||
}
|
||||
|
||||
bool UTF8StringHasNonASCII(const char *utf8string) {
|
||||
return UTF8StringNonASCIICount(utf8string) > 0;
|
||||
}
|
||||
@@ -35,4 +35,6 @@ private:
|
||||
int index_;
|
||||
};
|
||||
|
||||
int UTF8StringNonASCIICount(const char *utf8string);
|
||||
|
||||
bool UTF8StringHasNonASCII(const char *utf8string);
|
||||
Reference in new issue
Block a user