Closed eddiesshop closed 9 months ago
Get your most problematic CSV file, and see if this class will read it and process the rows.
$ wp shell > $csv = ( new FileImportFactory )->get_file( '/path/to/file' )->getIterator(); > foreach ($csv as $row ) { > var_dump( $row ); > }
I think this is the best way to handle charsets, but would appreciate if someone more knowledgeable than me could check or confirm.
Thanks for the review @naxoc!
That makes sense, I'll create another PR adding that flexibility.
How to test
Get your most problematic CSV file, and see if this class will read it and process the rows.
I think this is the best way to handle charsets, but would appreciate if someone more knowledgeable than me could check or confirm.