Balasekhar Nelli
Balasekhar Nelli

Reputation: 1295

wc -c and wc -m give the same output all the time?

I am having the following doubt. wc -m and wc -c are always giving same output. I tried with floating point numbers also but the output is same for both the commands.

 cat test | wc -m
 541
 cat test | wc -c
 541

Upvotes: 2

Views: 219

Answers (1)

user3056857
user3056857

Reputation: 113

ASCII character takes byte. But UTF-8 local charaters takes 2 bytes.

 echo -n "ŻÓŹŁŃĘ"|wc -m
 6
 echo -n "ŻÓŹŁŃĘ"|wc -c
 12

P.S. You can wc -m test to save cat.

Upvotes: 4

Related Questions