GNU bug report logs - #22064
expr: expr string : '.*' returns the number of matched bytes not characters

Previous Next

Package: coreutils;

Reported by: Stephane Chazelas <stephane.chazelas <at> gmail.com>

Date: Mon, 30 Nov 2015 21:11:01 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stephane Chazelas <stephane.chazelas <at> gmail.com>
To: 22064 <at> debbugs.gnu.org
Subject: bug#22064: expr: expr string : '.*' returns the number of matched bytes not characters
Date: Mon, 30 Nov 2015 21:09:45 +0000
Hello,

that's another multibyte issue, it may be known already but I
can't see it being referenced on debbugs.gnu.org.

$ locale charmap
UTF-8
$ expr é : .
2
$ expr é 

That is, characters are correctly matched, but a number of bytes
instead of characters is returned.

Same problem with

$ expr length é
2
$ expr index éx x
3


(with both 8.23 and git head on Debian testing).

-- 
Stephane






This bug report was last modified 6 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.