utf8: bug fix in get_uchar (#5775)

pull/5786/head
penguindark 2020-07-10 14:44:40 +02:00 committed by GitHub
parent 9839b0eb7f
commit e85c1fb762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ pub fn get_uchar(s string, index int) int {
ch_len = utf8util_char_len(s.str[index])
if ch_len == 1 {
return u16(s.str[0])
return u16(s.str[index])
}if ch_len > 1 && ch_len < 5{
mut lword := 0
for i:=0; i < ch_len ; i++ {