Comments (21)
Here is the test json, I had same issue with it. Let me know if you need more information.
test data.zip
Sorry for late reply, I think we have a huge time difference and I was really busy at work :)
from blazordownloadfile.
Install-Package BlazorDownloadFile -Version 2.1.6
encoderShouldEmitUTF8Identifier
is now false as default please remember turning this option true when downloading the csv file.
from blazordownloadfile.
It's working properly now! Thanks for the help!
from blazordownloadfile.
Seems weird to me, the DownloadFileFromText
should be able to support all characters since it's utf-8 but not every charset maybe in the same encoding format when reading from any source.
As you can see this extension method
Encodes all text to bytes using utf8, are you sure your problem exactly or may reside over there?
I don't think this should be a JavaScript issue at all but maybe from c# encoding since JavaScript downloads the file as-is without any encoding or conversions.
If you can send me a repro I may fix it.
Can you confirm that before sending the text to the DownloadFileFromText
method the text is correctly encoded and they get interpreted incorrectly after downloading and opening the file?
from blazordownloadfile.
That error can also occur with the text editor and how does it's interprets the characters.
What software you are using to open the csv file? MS Excel?
from blazordownloadfile.
As you can see here, when I call BlazorDownloadFile, the string was still okay.
I'm using MS Excel to open the csv file.
from blazordownloadfile.
Ok, good can you check which charset enconding is your MS Excel opening the csv file?
from blazordownloadfile.
Can you check if the .csv file opened in notepad to see if it's encoded wrongly?
from blazordownloadfile.
Can you check if the .csv file opened in notepad to see if it's encoded wrongly?
If opened in notepad is wrong then I will expose the charset encoding as an option with a default value to prevent breaking changes on the api.
Please let me know asap.
from blazordownloadfile.
I would like also to know if after using the extension to base64encode does your encoding gets broken.
from blazordownloadfile.
I opened the bad the file with notepad++.
But in excel:
The good file after changing the BlazorDownloadFile script in notepad++:
In excel:
from blazordownloadfile.
I tried to change the base64encode this code instead as you instructed
and we still get same bad result
from blazordownloadfile.
Thanks for the investigation and the input I will take a deeper look on it.
Can you share any sample data for me in json format?
So I can use it has a test case?
from blazordownloadfile.
Wait a minute I read this in a hurry, in notepad++ the file opened ok. But in excel is wrong but after changing the encoding file format in notepad++ the excel read ok?
from blazordownloadfile.
This seems to be an issue with excel on how interprets csv filed but not rather with this library and the download process.
from blazordownloadfile.
Please upload for me a test json data so I can retest those special chars there seems to be a workaround this in the reference link.
from blazordownloadfile.
New release
Install-Package BlazorDownloadFile -Version 2.1.4
@stevanuswijaya I didn't had time to test your attached file data but it should work for you out of the box.
I am in a hurry.
Please try out this new package version.
Take a look of this commit for more details.
I turned on by default encoderShouldEmitUTF8Identifier
so this should work for you out of the box.
Please try it out and give me your feedback when ever it's possible.
from blazordownloadfile.
Hi
Unfortunately, I still got same problem.
from blazordownloadfile.
Ok, give me a time so I can retest this with more free time, reopening.
from blazordownloadfile.
It's seems I got it working now.
from blazordownloadfile.
Install-Package BlazorDownloadFile -Version 2.1.5
Please give me feedback if this does work for you properly now!
from blazordownloadfile.
Related Issues (20)
- Enhancement: DownloadBinaryBuffers Needs to have a CancellationToken versions HOT 2
- Support Content-Disposition attachment response downloads for server/remote files.
- Feature request: Ability to configure IBlazorDownloadFileService lifetime HOT 9
- Extend the "DownloadFile(string fileName, ..." methods with IProgress HOT 5
- Download Excel file HOT 14
- Unable to download an exe file HOT 13
- Unable to download large file (Via byte[] or stream) HOT 11
- Throwing exception when using Content-Security-Policy "script-src 'self' " header HOT 7
- How to speed up download? HOT 2
- Upgrade to NET5 HOT 6
- namespaces not fount HOT 2
- Add support for file encoding HOT 5
- Naming Issue - DowloadFileResult HOT 2
- Upgrade and test NET6 HOT 2
- I was having an issue with an even smaller size (400kb ish) HOT 3
- Downloading PDF in Firefox redirects to blob:// HOT 3
- Trying to Download PDF but cant open it after download HOT 5
- Unable to download a file larger than 500 MB HOT 21
- use memorystreamdata for filecontent HOT 1
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 blazordownloadfile.