#782227 posh doesn't support multibyte characters in string handling

Package:
posh
Source:
posh
Description:
Policy-compliant Ordinary SHell
Submitter:
Vincent Lefevre
Date:
2015-04-09 12:54:10 UTC
Severity:
normal
#782227#5
Date:
2015-04-09 11:47:34 UTC
From:
To:
In UTF-8 based locales:

$ posh -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.

#782227#10
Date:
2015-04-09 12:50:59 UTC
From:
To:
Same problem with:

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

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