We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
参考: https://sites.google.com/site/fudist/Home/grep/sjis-damemoji-jp/table
sjis.csv
"hoge","テスト機構","fuga"
PHP
$csv = new CsvImportService(new SplFileObject(__DIR__ . '/sjis.csv')); foreach ($csv as $row) { echo count($row), ' ', var_export($row, true), '<br />'; }
実行結果
2 array ( 0 => 'hoge', 1 => '�e�X�g�@�\\",fuga"', )
CsvImportService::__construct()
public function __construct(\SplFileObject $file, $delimiter = ',', $enclosure = '"', $escape = '\\') { ini_set('auto_detect_line_endings', true); - $this->file = $file; + $tempFile = tmpfile(); + foreach ($file as $line) { + $encoded = mb_convert_encoding($line, 'UTF-8', 'SJIS-win'); + fwrite($tempFile, $encoded); + } + + $meta = stream_get_meta_data($tempFile); + $this->file = new SplFileObject($meta['uri'], 'r'); + fclose($tempFile); + $this->file->setFlags( \SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY |
3 array ( 0 => 'hoge', 1 => 'テスト機構', 2 => 'fuga', )
The text was updated successfully, but these errors were encountered:
ユニットテスト追加
e758646
see EC-CUBE#5252
#5407 で対応
Sorry, something went wrong.
No branches or pull requests
環境 (environment)
概要(Overview)
参考: https://sites.google.com/site/fudist/Home/grep/sjis-damemoji-jp/table
sjis.csv
PHP
実行結果
修正案
CsvImportService::__construct()
実行結果
The text was updated successfully, but these errors were encountered: