file open fixed to use codecs