From b390566b55700582321b09b72c726b8dff9bd819 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 12 Aug 2024 20:53:03 -0700 Subject: Support unicode identifier names. (#4772) * Support unicode identifier names. * Fix. * Fix language server. * Fix build errors. * Fix. * Fix offset translation in language server. --- source/core/slang-char-encode.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/core/slang-char-encode.h') diff --git a/source/core/slang-char-encode.h b/source/core/slang-char-encode.h index 2bb4cba29..a7cd501ab 100644 --- a/source/core/slang-char-encode.h +++ b/source/core/slang-char-encode.h @@ -203,6 +203,10 @@ struct UTF8Util /// Non valid utf8 input or ending starting in partial characters, will produce /// undefined results without error. static Index calcCodePointCount(const UnownedStringSlice& in); + + + /// Given a slice in UTF8, calculate the number of UTF16 characters needed to represent the string. + static Index calcUTF16CharCount(const UnownedStringSlice& in); }; } -- cgit v1.2.3