Use codepoint index for indices/1, index/ 1 and rindex/1 (#3065)

Previsouly byte index was used.

Fixes #1430 #1624 #3064
This commit is contained in:
Mattias Wadman authored and GitHub committed 2024-11-17 10:22:05 +01:00
1 parent a7b22539a4
commit 8619f8a8ac
2 files changed
+25 -3

No files matched your search

+16
View File
@@ -1416,6 +1416,22 @@ indices(", ")
"a,b, cd,e, fgh, ijkl"
[3,9,14]
index("!")
"здравствуй мир!"
14
.[:rindex("x")]
"正xyz"
"正"
indices("o")
"🇬🇧oo"
[2,3]
indices("o")
"ƒoo"
[1,2]
[.[]|split(",")]
["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"]
[["a"," bc"," def"," ghij"," jklmn"," a","b"," c","d"," e","f"],["a","b","c","d"," e","f","g","h"]]