Comments (19)
@midhunm-c branch is ready for you.
You can install it via npm install RonRadtke/react-native-blob-util#feature/utf8_fix
from react-native-blob-util.
Yeah you're right - I messed that one up when fixing the import cycles.
Version 0.13.14 should fix it. It's already live.
from react-native-blob-util.
Thank you so much @RonRadtke , and great collaboration @midhunm-c!
from react-native-blob-util.
@RonRadtke
this is a portion of the json file which makes problem.
{
"app/screens/onboarding/onboarding-button-texts/next": "Next",
"app/screens/contact/send-bulk-email": "إرسال بريد إلكتروني دعائي"
}
This is added to a json file in android document directory and tried to read using JSONStream. done or fail block not getting called.
If I removed this Arabic text from the json the JSONStream is calling the done block.
from react-native-blob-util.
Glad to hear :)
from react-native-blob-util.
Thank you @RonRadtke !!
Integrated the version 0.13.14 and now it's working fine :)
from react-native-blob-util.
Could you please provide a sample json that is problematic?
Don't need you full translation file, just a few lines that will cause the problem.
from react-native-blob-util.
@RonRadtke
While reading the json file with Arabic text from application document directory as JSONStream this following exception was throwing
I have fixed the issue in this PR, #53
Please review this PR.
from react-native-blob-util.
Thank you for your PR.
My problem is, it is not actually fixing the problem. It's a simple bad aid working for now. But in general there seems to be something off with either the data itself or what happens to the data before it being encoded.
So either there are characters in which are not covered by utf8 or somewhere goes something wrong.
So I'll have a closer look at the problem as soon as I have time for.
Also I don't like to have different handling for the different encodings. If we go for it, it would be better to ignore the encoding errors for all different types of encoding to have a similar behavior all over the code.
from react-native-blob-util.
Hello! I completely understand your comments, in fact I would say the same thing. That being said, is there any chance we can have a beta version with this quick fix until you can fix the actual problem? I'd really rather not fork this repo (yet again) and re-host just to have a temporary fix, and I don't have the time to invest in exploring other avenues for a fix.
from react-native-blob-util.
I pushed your fix on a feature branch. Due to the merge conflict I just copied it quickly.
It's the branch features/arabic_json_fix
So you should be able to install it by running npm install RonRadtke/react-native-blob-util#feature/arabic_json_fix
from react-native-blob-util.
Wonderful! Thank you so much, this is going to save us a lot of trouble!
from react-native-blob-util.
I'm relatively sure I know the cause of the problem now.
Basically there are only two options:
- Your file contains non-utf8 chars
- Something in the Lib is broken
I assume your file is fine, otherwise you would most likely have problems in iOS too.
Currently we are splitting the input in chunks of 4096 Bytes, but this doesn't respect the fact that UTF8 uses 1,2 or 3 bytes to encode a single character. So most likely we are cutting a valid character in half and thus you're seeing the error.
I hope I'll have the time to reimplement that part in the next week.
I would like to ask you to test the changes with your file to verify it's working fine - I hope you could help there @devinm-hrbl / @midhunm-c ?
I would come back to you then, as soon as it's implemented.
from react-native-blob-util.
Thank you very much @RonRadtke !!
Yeah sure, we can definitely test once you implemented the fix.
from react-native-blob-util.
@midhunm-c would it be a problem for you if I bump the minSDK to 19? I think I have a working solution for > APi 19.
That would on the other hand mean, you have to stay on a dev branch till I make the next major release, which I plan for September. (Hopefully I get the android scoped storage working till then)
Don't need to bump the API for this :) So I think you will get a branch to test tomorrow.
from react-native-blob-util.
Thank you @RonRadtke !!
I have checked from the branch feature/utf8_fix
and the language is loading without any exception. 👍
from react-native-blob-util.
@devinm-hrbl I published a new version including the fix.
Please shortly give me hint as soon as you migrated so I can delete the old branch you were using.
from react-native-blob-util.
Hi @RonRadtke thank you for the new release :)
I have checked from the new version v0.13.13.
But I am getting an infinite warning in console with this new version in both Android and iOS
Possible Unhandled Promise Rejection (id: 1292): TypeError: undefined is not a function (near '...ReactNativeBlobUtil.config...')
But I remember this warning were not in the last branch you have shared feature/utf8_fix
and ![image](https://user-images.githubusercontent.com/87301308/131387786-cb46be7c-fb4c-41fb-9bcc-8c9b3bd4f951.png)
.
PS:
I got this warning before when I was creating the PR from the forked repo. And I changed the import in polyfill/XMLHttpRequest.js
.
from react-native-blob-util.
Good - then I close the issue and delete the branch within the next days :)
from react-native-blob-util.
Related Issues (20)
- response.json() is throwing an Error in Android saying No such file or directory HOT 1
- dest.exists() check fails in writeStream() in files of type content:// HOT 1
- Using writeStream() with content:// Uris HOT 1
- File gets corrupted with readStream() with base64 when using bufferSize defaults
- java to kotlin change example HOT 5
- pathForAppGroup typescript error HOT 1
- Error opening APK file: installation package is corrupt HOT 3
- Integration network debugging react-native-debugger HOT 1
- Crash when readStream on IOS
- Problem with java.lang.RuntimeException: java.lang.IllegalStateException: Use of own trust manager but none defined HOT 1
- wifiOnly option doesn't work on iOS as expected
- copyToMediaStore does not work on Android versions lower than 10 HOT 2
- Upload Video [Error: The operation couldn’t be completed. Message too long] HOT 3
- [Error: Unexpected FileStorage response file: null] on android 14 HOT 1
- Run error in windows, due to the WindowsTargetPlatformMinVersion
- ReactNativeBlobUtil.fs does not work if path contains 'content://' HOT 1
- How to get access to assets file (issue opened after trouble shooting read). HOT 2
- Android 14 PDF Issues HOT 1
- Cancel Download function not working HOT 5
- Android: Native Crash App Issue "PDF renderer"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-blob-util.