utf8, readline: clarify UTF-8 vs UTF-32 usage (see also #22461) (#22558)

This commit is contained in:
Pepper Gray 2024-10-18 10:18:31 +02:00 committed by GitHub
parent decea1b188
commit ce8f62146b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 14 additions and 9 deletions

View file

@ -73,7 +73,7 @@ pub fn get_rune(s string, index int) rune {
return res
}
// raw_index - get the raw character from the string by the given index value.
// raw_index - get the raw unicode character from the UTF-8 string by the given index value as UTF-8 string.
// example: utf8.raw_index('我是V Lang', 1) => '是'
pub fn raw_index(s string, index int) string {
mut r := []rune{}