| 115 | |
| 116 | template <std::convertible_to<std::string_view> Utf8> |
| 117 | size_t CountChar(Utf8 const & utf8) |
| 118 | { |
| 119 | size_t codePoints = 0; |
| 120 | |
| 121 | for (auto const c : utf8) |
| 122 | if ((c & 0xC0) != 0x80) |
| 123 | ++codePoints; |
| 124 | |
| 125 | return codePoints; |
| 126 | } |
| 127 | |
| 128 | bool Truncate(std::string & utf8, size_t const maxTextLengthPlus1); |
| 129 |
no outgoing calls
no test coverage detected