Package: posh
Version: 0.12.3
Severity: normal

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.

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages posh depends on:
ii  debconf [debconf-2.0]  1.5.56
ii  libc6                  2.19-17

posh recommends no packages.

posh suggests no packages.

-- debconf information:
  posh/sh: false


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to