initial fix for RT68289

I have not audited ALL of the code for utf-8 problem points, but this is at least part of the fix.