| 155 | } |
| 156 | |
| 157 | string UTF8ToLower(const string& in) { |
| 158 | string out; |
| 159 | out.resize(in.size()); |
| 160 | for (unsigned i = 0; i < out.size(); i++) { |
| 161 | // A to Z in unicode, this is all the letters in the world, right? |
| 162 | if (in[i] >= 0x41 && in[i] <= 0x5A) { |
| 163 | out[i] = in[i] + 0x20; |
| 164 | } else { |
| 165 | out[i] = in[i]; |
| 166 | } |
| 167 | } |
| 168 | return out; |
| 169 | } |
| 170 | |
| 171 | int UTF8ToLower(char* out, size_t outsize, const char* in) { |
| 172 | // We should be using the ICU lib for this, but good god, it's massive and difficult, |
no test coverage detected