mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: make char literals wide (#7769)
This commit is contained in:
@@ -4,3 +4,11 @@ fn test_utf8_char_len() {
|
||||
s := 'п'
|
||||
assert utf8_char_len(s[0]) == 2
|
||||
}
|
||||
|
||||
fn test_utf8_wide_char() {
|
||||
r := `🌎`
|
||||
val := r.str().str
|
||||
unsafe {
|
||||
assert '${val[0]:x}${val[1]:x}${val[2]:x}${val[3]:x}' == 'f09f8c8e'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user