From adacad2338fbfa7e13154c1a1dbe0e51730cacc5 Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Sun, 3 Sep 2017 22:23:55 +0900 Subject: [PATCH] Attempt to fix multibyte padding in stats tool --- tools/stats.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/stats.php b/tools/stats.php index cec8d2ab..00214842 100755 --- a/tools/stats.php +++ b/tools/stats.php @@ -1,5 +1,6 @@ #!/usr/bin/php fetch()) { - printf("%10s || ", $f['uri']); + $str = $f['uri']; + $str = mb_str_pad($str,10," ", STR_PAD_LEFT, "UTF-8"); + printf("%s || ", $str); foreach ($variants as $iter) { list($term, $time) = $iter; $qq = query(sprintf("SELECT COUNT(*) as count FROM ``posts_%s`` WHERE time > %d", $f['uri'], time()-$time));