printf and utf-8

Svein Halvor Halvorsen svein.h at lvor.halvorsen.cc
Mon Jan 26 13:52:04 PST 2009


As far as I can see, printf is not calculating strings lengths correctly 
when using utf-8 encoding. Either that, or I'm using byte count, and 
can't find the character count :-/

Eg:

$ printf "|%-10s|" "æøå"
|æøå    |

$ printf "|%-10s|" "123"
|123       |

I'm on 7.1-p2



	sv.


More information about the freebsd-questions mailing list