| 320 | }; |
| 321 | |
| 322 | std::string to_search_normalized(const std::string &str) |
| 323 | { |
| 324 | std::string result; |
| 325 | result.reserve(str.size()); |
| 326 | for (char c : str) |
| 327 | { |
| 328 | const char *mapped = normalized_table[(uint8_t)c]; |
| 329 | if (mapped == NULL) |
| 330 | result += tolower(c); |
| 331 | else |
| 332 | while (*mapped != '\0') |
| 333 | { |
| 334 | result += tolower(*mapped); |
| 335 | ++mapped; |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | return result; |
| 340 | } |
| 341 | |
| 342 | std::string capitalize_string_words(const std::string& str) |
| 343 | { // Cleaned up from g_src/basics.cpp, and returns new string |
no test coverage detected