Open chenguo4930 opened 2 years ago
// txt文件在ios上显示乱码 final contents = File(fileEntity.filePath).readAsStringSync(); fileEntity.filePath = fileEntity.filePath.replaceAll('.txt', '_temp.txt'); File(fileEntity.filePath).writeAsStringSync(contents.trim(), encoding: gbk, flush: true);
我是这样处理的,但是总是会抱错:RangeError (index): Invalid value: Not in range 0..100034, -1000023
是用gbk编码插件造成的换一个就好
// txt文件在ios上显示乱码 final contents = File(fileEntity.filePath).readAsStringSync(); fileEntity.filePath = fileEntity.filePath.replaceAll('.txt', '_temp.txt'); File(fileEntity.filePath).writeAsStringSync(contents.trim(), encoding: gbk, flush: true);
我是这样处理的,但是总是会抱错:RangeError (index): Invalid value: Not in range 0..100034, -1000023