[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTF-8 printf string formating problem

From: Jan Novak
Subject: Re: UTF-8 printf string formating problem
Date: Sun, 06 Apr 2014 13:24:58 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Chris Down wrote:
I don't have much of an opinion on whether this behaviour is right or
wrong in the context of bash, but if this behaviour is changed, I think
it should be done under another format character, rather than changing
%s (or changing behaviour when not in POSIX-compliance mode).

IMHO my example demonstrates clearly, that printf output of UTF-8 chars is 
(doesn't matter, if it is or not POSIX compliant).

To solve this problem I suppose to add "wide" switch to printf
or to add "%S" format   (similarly to wprintf(3) )

$ printf -w "|%4s|\n" "áá"
$ printf "|%4S|\n" "áá"
|  áá|

reply via email to

[Prev in Thread] Current Thread [Next in Thread]