Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug if the chunk split inside an UTF-8 (or other encoding) character #1

Closed
jersou opened this issue May 6, 2022 · 3 comments
Closed

Comments

@jersou
Copy link

jersou commented May 6, 2022

For information : denoland/deno#14507

My workaround :

- parser.parse(stream);  
+ stream
+    .pipeThrough(new TextDecoderStream(encoding))
+    .pipeTo(new WritableStream({ write: (str) => parser.parse(str) }));

That said, thank you for this lib ! And for option 'string' in the parse() method that permit this workaround :-)

@masataka
Copy link
Owner

masataka commented May 7, 2022

@jersou

Thank you for letting me know the issue.
When I created this library, TextDecoderStream wasn't provided, so I didn't know a good way to resolve the encoding with a stream, which is a good solution. and ... I found "Deno.copy" was deprecated.
I will try to solve them non-destructively.

I was born in the double-byte area, but I'm embarrassed to cut corners in encoding.

@masataka
Copy link
Owner

masataka commented May 7, 2022

@jersou

Please check v0.3.0.

@jersou
Copy link
Author

jersou commented May 7, 2022

👍 the v0.3.0 fix this bug, Thanks !

@jersou jersou closed this as completed May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants