[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#782225: marked as done (mksh: parameter expansion: string length ${#parameter} is incorrect on multibyte character)



Your message dated Thu, 9 Apr 2015 12:04:43 +0000 (UTC)
with message-id <Pine.BSM.4.64L.1504091203300.20298@herc.mirbsd.org>
and subject line Re: Bug#782225: mksh: parameter expansion: string length ${#parameter} is incorrect on multibyte character
has caused the Debian Bug report #782225,
regarding mksh: parameter expansion: string length ${#parameter} is incorrect on multibyte character
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
782225: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782225
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: mksh
Version: 50d-5
Severity: normal

In UTF-8 based locales:

$ mksh -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 mksh depends on:
ii  libc6  2.19-17

mksh recommends no packages.

Versions of packages mksh suggests:
ii  ed  1.10-2

-- no debconf information

--- End Message ---
--- Begin Message ---
Vincent Lefevre dixit:

>In UTF-8 based locales:

>$ mksh -c 'a=$(/usr/bin/printf \\u00e9); echo $a ${#a}'

tglase@tglase:~ $ mksh -c 'a=$(/usr/bin/printf \\u00e9); echo $a ${#a}'
é 2
tglase@tglase:~ $ mksh -Uc 'a=$(/usr/bin/printf \\u00e9); echo $a ${#a}'
é 1

This works as specified for mksh: UTF-8 mode is disabled by
default in scripts or for -c to not break any existing scripts.

bye,
//mirabilos
-- 
(gnutls can also be used, but if you are compiling lynx for your own use,
there is no reason to consider using that package)
	-- Thomas E. Dickey on the Lynx mailing list, about OpenSSL

--- End Message ---

Reply to: