archive icon indicating copy to clipboard operation
archive copied to clipboard

ArchiveFile.string incorrect encodes non-ASCII data (causes dataloss)

Open Hixie opened this issue 11 months ago • 1 comments

The code currently says:

  _content = Uint8List.fromList(content.codeUnits);

This causes Unicode characters above U+00FE to all get turned into U+00FF and then causes the data to be encoded using ISO-8859-1, which is rather archaic.

I think that line should probably be this instead:

  _content = utf8.encode(content.codeUnits);

Hixie avatar Feb 26 '24 06:02 Hixie

Looks like the main constructor has a similar behaviour.

Hixie avatar Feb 26 '24 07:02 Hixie

Is this already fixed?

urusai88 avatar Jul 17 '24 19:07 urusai88

Looks like it was changed a little while ago,. I'll close this issue.

brendan-duncan avatar Jul 17 '24 19:07 brendan-duncan