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

...ut string