mirror of
https://github.com/google/go-jsonnet.git
synced 2026-05-05 03:56:11 +02:00
We're currently working with the length of the string itself, which is
the number of bytes. That's wrong in these functions which operate at
the level of characters. When applied to a string with a multibyte
character they can return the wrong result. For example, evaluating
`std.rstripChars('• foo\n', '\n')` results in `"• f"`.
What we need to do instead is get the number of runes, and remove one
rune at a time.
2 lines
35 B
Jsonnet
2 lines
35 B
Jsonnet
std.rstripChars('• foo\n', '\n')
|