Skip to content

Commit

Permalink
fix: encoding should be UTF-16 when file format is mdd
Browse files Browse the repository at this point in the history
  • Loading branch information
mumu-lhl committed Aug 12, 2024
1 parent 015e02a commit efffc04
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/src/dict_reader_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ class DictReader {
final tags = _parseHeader(content);

String? encoding = tags["Encoding"];
if (_mdx) {
encoding ??= "UTF-8";
} else {
encoding ??= "UTF-16";
if (encoding == null || encoding == "") {
if (_mdx) {
encoding = "UTF-8";
} else {
encoding = "UTF-16";
}
}
// GB18030 > GBK > GB2312
if (["GBK", "GB2312"].contains(encoding)) {
Expand Down

0 comments on commit efffc04

Please sign in to comment.