Content is corrupted in case of utf8 multibyte characters
See original GitHub issueI found that in version 5.1.0 downloaded cvs parsed incorrectly in case if source data contains utf8 multibyte characters (whereas 5.0.2 didn’t have this issue). I noticed that PapaParse tried to download second chunk even if there no any extra bytes:
First chunk:
< Content-Length: 184027
< Content-Range: bytes 0-184026/184027
Second chunk (not necessary)
> Range: bytes=183546-5426425
< Content-Length: 481
< Content-Range: bytes 183546-184026/184027
After some digging I think that problem here
this._start += xhr.responseText.length;
Because Content-Length can be greater then text length (because some characters can be 2 or more bytes).
I think it should be something like this:
this._start += +xhr.getResponseHeader('Content-Length');
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
java - Multibyte Characters corrupt to ???? when read from ...
In my java code,I am retrieving some multibyte data from database and making some xml DOM, with that data as the value of...
Read more >Multi-byte characters corrupted in JSON POST payload #40
I'm thinking we need to replicate the content-type and encoding of the incoming request as we proxy it to the backend. In ...
Read more >UTF-8 corruption warning with chUI - Progress Community
The issues occur when you assign a value from a widget which is displayed onscreen. Widgets in character mode don't support UTF-8 characters....
Read more >Special character (three-byte Unicode character) gets corrupted ...
The following highlighted characters get corrupted when it is read by PowerCenter from an Oracle database with UTF - 8 codepage:.
Read more >Correcting Corrupted Characters – Eric's Archived Thoughts
If you are (relatively) sure that the data got converted to latin1/iso-8859-1, you can convert it back to utf-8 using mysql. You would...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, so I’ve merged #745 which fixes this
I’ve just published 5.1.1 which contains this fix!