encoding utf-8 strings before write, more special cases