cgen: fix illegal character encoding with rune consts above 127 (#11550)
parent
1de4f1af2e
commit
9c4507d115
|
@ -5210,7 +5210,7 @@ fn (mut g Gen) const_decl_precomputed(mod string, name string, ct_value ast.Comp
|
|||
}
|
||||
rune {
|
||||
rune_code := u32(ct_value)
|
||||
if rune_code <= 255 {
|
||||
if rune_code <= 127 {
|
||||
if rune_code in [`"`, `\\`, `'`] {
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
const accented = `á`
|
||||
|
||||
fn test_high_ascii_const() {
|
||||
assert u32(accented) == 225
|
||||
}
|
Loading…
Reference in New Issue