IO: use codecs so that unicode decode does not raise