[[ Bug 13043 ]] Ensure utf8 length is used when calculating size of output string
Merge pull request #981 from runrevali/bugfix-13043

[[ Bug 13043 ]] Ensure utf8 length is used when calculating size of outp...