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

FileReader splits special characters up which leads to exception and null result #562

Open
ExtraFisch opened this issue Mar 10, 2023 · 0 comments

Comments

@ExtraFisch
Copy link

ExtraFisch commented Mar 10, 2023

Bug Report

What is expected to happen?

The FileReader should read a file correctly.

What does actually happen?

FileReader returns null

Information

Today i noticed a special case where I was reading a JSON file with the FileReader. It returned null for some reason. When I made a small change to the file it worked. I debugged into it and found out that the FileReader has this READ_CHUNK_SIZE. It splits the file into chunks while reading. At some point it creates a string out if the byte buffer again. At this point the exception occures as the reader read just half of a special character into the buffer. Thats because special UTF-8 characters can be represented by more than one byte. In my case it was a degree sign "°".

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

1 participant