0

I'm using Maatwebsite excel v ~2.1.0 for my Laravel 5.2 project. My problem is that the japanese characters are not rendered as seen the photo below. As you can see, I have 23 heading rows and the displayed data only are only English characters. Columns that uses Japanese characters are null.

data

This is my data in my CSV file.

enter image description here

This is my approach in loading the CSV file:

Excel::load(request()->file('file'), function($reader) {
    $results = $reader->all();
    dd($results);
});

What should I change to make the Japanese characters readable?

Eem Jee
  • 1,239
  • 5
  • 30
  • 64
  • Does this answer your question? [PHP DOMDocument loadHTML not encoding UTF-8 correctly](https://stackoverflow.com/questions/8218230/php-domdocument-loadhtml-not-encoding-utf-8-correctly) – rkg Apr 03 '20 at 02:51
  • @rkg Unfortunately, that is HTML element encoding, not CSV. I have answered my question anyway, please see below. – Eem Jee Apr 03 '20 at 03:17

1 Answers1

0

Okay after exploring more, I found out the answer. In excel.php file, I changed 'to_ascii' => true, to 'to_ascii' => false and my problem is fixed. Hope this helps someone in the near future.

Eem Jee
  • 1,239
  • 5
  • 30
  • 64