bug#20751: wc -m doesn't count UTF-8 characters properly

2015-06-07 Thread Valdis Vītoliņš
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

bug#20751: wc -m doesn't count UTF-8 characters properly

2015-06-07 Thread Stephane Chazelas
2015-06-06 21:49:16 +0300, Valdis Vītoliņš: Note, that UTF-8 characters can be counted by counting bytes with bit patterns 0xxx or 11xx: https://en.wikipedia.org/wiki/UTF-8#Description So, general logic should be, that, if: a) locale setting is utf-8 (e.g. LANG=xx_XX.UTF-8), or b)

bug#20767: seq invocation limitations documentation

2015-06-07 Thread 積丹尼 Dan Jacobson
On (info (coreutils) seq invocation) perhaps mention if one needs to use two % items, a for loop might be required, $ for i in `seq 14484 1 34484`; do printf %d=0x%x\\n $i $i; done 14484=0x3894 24484=0x5fa4 34484=0x86b4