Browse Source

Fix for using utf8string.at with last rune index returning wrong rune.

Karl Zylinski 9 months ago
parent
commit
36b958c120
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/unicode/utf8/utf8string/string.odin

+ 1 - 1
core/unicode/utf8/utf8string/string.odin

@@ -66,7 +66,7 @@ at :: proc(s: ^String, i: int, loc := #caller_location) -> (r: rune) {
 		return
 
 	case s.rune_count-1:
-		r, s.width = utf8.decode_rune_in_string(s.contents)
+		r, s.width = utf8.decode_last_rune(s.contents)
 		s.rune_pos = i
 		s.byte_pos = _len(s.contents) - s.width
 		return