OK, this is a bug in busybox shell. Old version of busybox returned string length in bytes, now it returns string length in characters. However, when using substring indexing, it still expects a byte offset, which is now impossible to determine. Given the wrong byte offset, it ends up cutting into multibyte characters and mangling them.
It worked fine in the old busybox (using bytes everywhere), works fine in Bash (using characters everywhere), doesn't work in current busybox (mixed bytes and characters).
It works fine for ascii only files and folders, as characters and bytes are identical there.
To fix, I'll have to rewrite without relying on the shell string manipulation functions.
|