GNU bug report logs - #20751
wc -m doesn't count UTF-8 characters properly

Previous Next

Package: coreutils;

Reported by: valdis.vitolins <at> odo.lv

Date: Sat, 6 Jun 2015 17:12:03 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #21 received at 20751 <at> debbugs.gnu.org (full text, mbox):

From: Valdis Vītoliņš <valdis.vitolins <at> odo.lv>
To: 20751 <at> debbugs.gnu.org
Subject: Re: bug#20751: wc -m doesn't count UTF-8 characters properly
Date: Sun, 07 Jun 2015 23:50:27 +0300
Thanks for clarification!

I tested it with Bash script:
chars=$(wc -m mylog|cut -d ' ' -f1)
lines=$(wc -l mylog|cut -d ' ' -f1)
let chars="$chars - $lines"
echo $chars

and got the same number as given by vim
:%s/.//gn

(Which was place from what I got confused.)

Hopefully this bug description will help to others.

> 
> I think it's working correctly.
> I.E. the \n is included in the count.
> 
> thanks,
> Pádraig.
> 






This bug report was last modified 9 years and 354 days ago.

Previous Next


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