[dev] [9base][awk] printf and utf-8

From: Peter A. Shevtsov <petr.shevtsov_AT_gmail.com>
Date: Tue, 22 Jan 2013 14:32:45 +0700

Hello,

I've found the bug in 9base's awk. It seems that printf works incorrectly with utf-8
strings. The way it counts string lengs is weird:

echo latin кириллица | /usr/local/plan9/bin/awk '{printf("[%20s][%20s]\n", $1, $2)}'

and the output is:

[ latin][ кириллица]

It seems that it counts every cyrillic letter as two, i. e. it ain't count letters
(or runes) but bytes.
Received on Tue Jan 22 2013 - 08:32:45 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 22 2013 - 08:36:04 CET