From: Jose Date: 2007-12-07T09:54:59+09:00 Subject: Re: UTF-8 and printf On 5 dic, 14:58, MonkeeSage wrote: > Unfortunately, I think you'll have to use something ugly like this... > > def pad(n, s) > (" " * (n - s.unpack("U*").length)) + s > end > [...] Hey, thank you very much. The trick of unpack to find the string length is a nice one. And s.unpack("U*").length is only 4 times slower than s.length, according to my benchmarks. Anybody knows this printf "bug" will be solved in ruby 1.9? Regards, --Jose