Fix #17376: Perf: use sprintf over utf8_str_pad

Patch from grangeway's original pull request [1].

[1] fixes https://github.com/mantisbt/mantisbt/pull/182

Signed-off-by: Damien Regad <dregad@mantisbt.org>