+ if(String.width(out)>8) + out=string_to_utf8(out);
Ok, seriously, I think for every proper use of String.width (are there any?) there are at least two improper ones.
If the string is supposed to be transport encoded with UTF-8, you need to do it for _all_ strings, otherwise you will get invalid UTF-8 if the string contains characters > 127 but < 256.
But who says that a "tabular" should be UTF-8 encoded anyway? For a format that has no builtin encoding indicator, transport en/decoding should be the task of the caller.