Package: dash
Version: 0.5.7-4+b1
Severity: normal

In UTF-8 based locales:

$ dash -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 dash depends on:
ii  debianutils  4.4+b1
ii  dpkg         1.17.24
ii  libc6        2.19-17

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true


-- 
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