support non-utf8 encodings for upload