8000 flutter代码怎样将,txt文档编码改成gbk? · Issue #56 · fluttercandies/flutter_filereader · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.
This repository was archived by the owner on Jun 24, 2024. It is now read-only.
flutter代码怎样将,txt文档编码改成gbk? #56
Open
@chenguo4930

Description

@chenguo4930

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0