mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Fix unicode handling
This commit is contained in:
@@ -1033,7 +1033,12 @@ Returns:
|
|||||||
_split_iterator :: proc(s: ^string, sep: string, sep_save: int) -> (res: string, ok: bool) {
|
_split_iterator :: proc(s: ^string, sep: string, sep_save: int) -> (res: string, ok: bool) {
|
||||||
m := index(s^, sep)
|
m := index(s^, sep)
|
||||||
if sep == "" {
|
if sep == "" {
|
||||||
m = 1 if len(s) > 0 else -1
|
if len(s) == 0 {
|
||||||
|
m = -1
|
||||||
|
} else {
|
||||||
|
_, w := utf8.decode_rune_in_string(s^)
|
||||||
|
m = w
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if m < 0 {
|
if m < 0 {
|
||||||
// not found
|
// not found
|
||||||
|
|||||||
Reference in New Issue
Block a user