| 277 | } |
| 278 | |
| 279 | static int CountUtf8Chars(uint8_t* ptr, int len) { |
| 280 | if (ptr == nullptr) return 0; |
| 281 | int cnt = 0; |
| 282 | for (int i = 0; i < len; ++i) { |
| 283 | if (BitUtil::IsUtf8StartByte(ptr[i])) ++cnt; |
| 284 | } |
| 285 | return cnt; |
| 286 | } |
| 287 | |
| 288 | IntVal StringFunctions::Utf8Length(FunctionContext* context, const StringVal& str) { |
| 289 | if (str.is_null) return IntVal::null(); |
no outgoing calls
no test coverage detected