summaryrefslogtreecommitdiff
path: root/source/core/slang-char-encode.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-char-encode.h')
-rw-r--r--source/core/slang-char-encode.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/core/slang-char-encode.h b/source/core/slang-char-encode.h
index a778cc3c9..2bb4cba29 100644
--- a/source/core/slang-char-encode.h
+++ b/source/core/slang-char-encode.h
@@ -195,6 +195,16 @@ protected:
static CharEncoding*const g_encoding[Index(CharEncodeType::CountOf)];
};
+struct UTF8Util
+{
+ /// Given a slice calculate the number of code points (unicode chars)
+ ///
+ /// NOTE! This doesn't check the *validity* of code points/encoding.
+ /// Non valid utf8 input or ending starting in partial characters, will produce
+ /// undefined results without error.
+ static Index calcCodePointCount(const UnownedStringSlice& in);
+};
+
}
#endif