Answering myself: On 04/24/2015 10:38 PM, Assaf Gordon wrote:
I seem to get unexpected result with '-L' when forcing C locale.
<...>
# using C locale, characters=bytes=3, # but longest line is 0 ? $ printf "\xe2\x99\xa5" | LC_ALL=C wc -cmL 3 3 0This could be because of wc.c line 492, where "isprint" is called on each byte (e.g. isprint('\xe2') is false), and so these characters are not counted at all?
Under C locale these characters are not printable, so not counted. So technically, '-L' prints longest line using only printable characters under the locale, which is different then the 'characters/-m' definition. meaning it's quite tricky to count longest line of bytes in a file. perhaps my previous patch should be reworded...
