fix handling of non-ascii string formatting