summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fxcrt/fx_ext.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/fxcrt/fx_ext.h b/core/fxcrt/fx_ext.h
index d7f21af9ff..8224087d88 100644
--- a/core/fxcrt/fx_ext.h
+++ b/core/fxcrt/fx_ext.h
@@ -57,15 +57,19 @@ inline bool FXSYS_iswspace(wchar_t c) {
return (c == 0x20) || (c == 0x0d) || (c == 0x0a) || (c == 0x09);
}
+inline bool FXSYS_isHexDigit(const char c) {
+ return !((c & 0x80) || !std::isxdigit(c));
+}
+
inline int FXSYS_toHexDigit(const char c) {
- if (!std::isxdigit(c))
+ if (!FXSYS_isHexDigit(c))
return 0;
char upchar = std::toupper(c);
return upchar > '9' ? upchar - 'A' + 10 : upchar - '0';
}
inline bool FXSYS_isDecimalDigit(const char c) {
- return !!std::isdigit(c);
+ return !((c & 0x80) || !std::isdigit(c));
}
inline bool FXSYS_isDecimalDigit(const wchar_t c) {
@@ -73,7 +77,7 @@ inline bool FXSYS_isDecimalDigit(const wchar_t c) {
}
inline int FXSYS_toDecimalDigit(const char c) {
- return std::isdigit(c) ? c - '0' : 0;
+ return FXSYS_isDecimalDigit(c) ? c - '0' : 0;
}
inline int FXSYS_toDecimalDigit(const wchar_t c) {