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

[QUESTION] How to dynamic set encoding when import CSV file #1364

Closed
gamevnlc opened this issue Sep 18, 2017 · 3 comments
Closed

[QUESTION] How to dynamic set encoding when import CSV file #1364

gamevnlc opened this issue Sep 18, 2017 · 3 comments

Comments

@gamevnlc
Copy link

gamevnlc commented Sep 18, 2017

Package version, Laravel version

Laravel 5.4
maatwebsite/excel 2.1.22

Expected behaviour

I want to know how to dynamic set encoding when import from CSV file when use chunk importer

Actual behaviour

All data is not UTF-8 will be remove

CSV File

https://drive.google.com/file/d/0Bz-YEwnA8p4RTWRHQ09GSDQxWnc/view?usp=sharing

@aliusa
Copy link

aliusa commented Sep 19, 2017

Have you tried the way docs says?

// When utilising a closure, you can pass the input encoding as third parameter.
Excel::load('filename.csv', function($reader) {

}, 'UTF-8');

@gamevnlc
Copy link
Author

@aliusa
Oh I am sorry,
I want to know how to dynamic set encoding when use chunk importer. I forgot to add this to question

@glgeorgiev glgeorgiev mentioned this issue May 8, 2018
4 tasks
@gopalkriagg
Copy link

For people who stumble on this issue from Google Search like I did, this part of the documentation solves this issue: https://docs.laravel-excel.com/3.1/imports/custom-csv-settings.html
You can pass the encoding in the constructor of the Import Class that you create.

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

4 participants