#782228 busybox sh doesn't support multibyte characters in string handling

Package:
busybox
Source:
busybox
Description:
Tiny utilities for small and embedded systems
Submitter:
Vincent Lefevre
Date:
2015-04-09 12:54:15 UTC
Severity:
normal
#782228#5
Date:
2015-04-09 11:49:24 UTC
From:
To:
In UTF-8 based locales:

$ busybox sh -c 'a=$(/usr/bin/printf \\u00e9); echo $a ${#a}'
é 2

while POSIX says[*]:

  ${#parameter}
    String Length. The length in characters of the value of parameter
    shall be substituted.

[*] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

This the length in *characters*, not in bytes!

So, the output should be "é 1" like with bash, ksh93 and zsh.

#782228#10
Date:
2015-04-09 12:52:20 UTC
From:
To:
Same problem with:

  busybox sh -c 'case é in ?) echo OK;; esac'

which doesn't print OK in UTF-8 locales.