diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc index 4cb8b573cc1312..f3935dbc2d2dbc 100644 --- a/src/inspector/node_string.cc +++ b/src/inspector/node_string.cc @@ -1,5 +1,6 @@ #include "node_string.h" #include "node/inspector/protocol/Protocol.h" +#include "simdutf.h" #include @@ -118,9 +119,8 @@ const uint8_t* CharactersUTF8(const String& s) { } size_t CharacterCount(const String& s) { - icu::UnicodeString utf16 = - icu::UnicodeString::fromUTF8(icu::StringPiece(s.data(), s.length())); - return utf16.countChar32(); + // TODO(@anonrig): Add a test to validate CharacterCount returns correct value. + return simdutf::utf32_length_from_utf8(s.data(), s.length()); } } // namespace StringUtil