-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Incorrect utf-8 handling on require('file.yaml') #54
Comments
Can you please provide a broken YAML example, so I could play with it. |
js and yaml: That file filled with cyrillic letter 'у' (two bytes). The bug appears near 8k buffer boundary on odd aligned utf8 bytes. |
Yes, you're absolutely right. We read stream by 4K chunks, so it gets broken when it reads half of a unicode char. |
As we are not using asynchronous work with input streams, there was no point of using |
When js-yaml loads long files with multibyte utf-8 symbols sometimes it brokes characters (replaces valid unicode char by two error marks)
Probably it happens when utf-8 symbol lays exactly on read buffer boundary and byte reader splits it on two incorrect parts.
The text was updated successfully, but these errors were encountered: