Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2009 07:44:15 -0900
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Cc:        Svein Halvor Halvorsen <svein.h@lvor.halvorsen.cc>
Subject:   Re: printf and utf-8
Message-ID:  <200901270744.16043.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <497E31EE.9010202@lvor.halvorsen.cc>
References:  <497E31EE.9010202@lvor.halvorsen.cc>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 26 January 2009 12:58:06 Svein Halvor Halvorsen wrote:
> 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|" "=E6=F8=E5"
>
> |=E6=F8=E5    |
>
> $ printf "|%-10s|" "123"
>
> |123       |
>
> I'm on 7.1-p2

Does this work on an xterm (or anything else then the FreeBSD console) with=
=20
correct LANG variable set?
The FreeBSD console does not work with utf-8 (yet), allthough I would not=20
think it should affect printf's character counting, still.....it haunts me.
=2D-=20
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901270744.16043.fbsd.questions>