Fix lack of encoding to UTF-8 #6
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mostly it's PR to fix https://github.com/sveltejs/svelte/issues/3323
I think the issue should be fixed here because this library generates archives with content that doesn't match the one passed to the input.
The first thing is that the library doesn't convert Unicode char codes to UTF-8's.
The second is that for surrogate characters, the lib is ignoring the second character of the pair.
For both cases, added tests with checking of the unzipped content.
Here are logs of new tests without encoding the input text:
Test 8 checks encoding of characters above 0x7F and the first letters of the Cyrillic alphabet were turned to numbers XD
Test 9 checks encoding of surrogate characters (used to display symbols above 0xFFFF) - the sample symbol was turned to \0.