Commit 2ccfb71d authored by Max Kellermann's avatar Max Kellermann

util/CharUtil: add ToLowerASCII()

parent e8a5a9b1
...@@ -126,4 +126,17 @@ ToUpperASCII(char ch) ...@@ -126,4 +126,17 @@ ToUpperASCII(char ch)
: ch; : ch;
} }
/**
* Convert the specified ASCII character (0x00..0x7f) to lower case.
* Unlike toupper(), it ignores the system locale.
*/
constexpr
static inline char
ToLowerASCII(char ch)
{
return ch >= 'A' && ch <= 'Z'
? (ch + ('a' - 'A'))
: ch;
}
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment