On Sunday, April 06, 2014 01:24:58 PM Jan Novak wrote:
> To solve this problem I suppose to add "wide" switch to printf
> or to add "%S" format   (similarly to wprintf(3) )

ksh93 already has this feature using the "L" modifier:

ksh -c "printf '%.3Ls\n' $'\u2605\u2605\u2605\u2605\u2605'"
★★★
bash -c "printf '%.3Ls\n' $'\u2605\u2605\u2605\u2605\u2605'"
★

Also, zsh does this by default with no special option. I tend to lean towards 
going by character anyway because that's what most shell features such as "read 
-N" do, and most work directly involving the shell is with text not binary data.
-- 
Dan Douglas

Reply via email to