fix encoding for import
start implement exporting