Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

flutter代码怎样将,txt文档编码改成gbk? #56

Open
chenguo4930 opened this issue Nov 24, 2021 · 1 comment
Open

flutter代码怎样将,txt文档编码改成gbk? #56

chenguo4930 opened this issue Nov 24, 2021 · 1 comment

Comments

@chenguo4930
Copy link

// 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

@SongLinYang12138
Copy link

是用gbk编码插件造成的换一个就好

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants