question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content is corrupted in case of utf8 multibyte characters

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
pokolicommented, Nov 20, 2019

Ok, so I’ve merged #745 which fixes this

0reactions
pokolicommented, Dec 18, 2019

I’ve just published 5.1.1 which contains this fix!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found