You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [*] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
$sheetData = [
Code,
Price (£),
Description
]
What is the current behavior?
my csv file headers looks like "Code,Qty,Price (£),Description,RRP,Ean" what I find is that "Price (£)" is replaced with "false" the array looks like "Code,Qty,false,Description,RRP,Ean" It only does this with the pound sign, the dollar or euro is fine.
$sheetData = [
Code,
false,
Description
]
What are the steps to reproduce?
csv file
Code,Qty,Price (£),Description,RRP,Ean
01,10.15,Size 12 L
$spreadsheet = PhpOffice\PhpSpreadsheet\IOFactory::load($csvFile);
$worksheet = $spreadsheet->getAllSheets();
$sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; $i++) {
$sheet = $spreadsheet->getSheet($i);
$sheetData = $sheet->toArray(null, true, false, false); //this is where the issue is at
}
### Which versions of PhpSpreadsheet and PHP are affected?
1.15.0
The text was updated successfully, but these errors were encountered:
I believe this is a problem with the encoding of your file. When the csv file has been save as UTF-8 with BOM, PhpSpreadsheet and Excel read it correctly. However, when it is saved as CP1252 (which is sort of the default), Excel reads it correctly but PhpSpreadsheet produces the result you report. UTF-8 without BOM - PhpSpreadsheet correct, Excel not. However, if you know your file has been saved as CP1252, PhpSpreadsheet can still give you the desired result:
This is:
What is the expected behavior?
$sheetData = [
Code,
Price (£),
Description
]
What is the current behavior?
my csv file headers looks like "Code,Qty,Price (£),Description,RRP,Ean" what I find is that "Price (£)" is replaced with "false" the array looks like "Code,Qty,false,Description,RRP,Ean" It only does this with the pound sign, the dollar or euro is fine.
$sheetData = [
Code,
false,
Description
]
What are the steps to reproduce?
csv file
Code,Qty,Price (£),Description,RRP,Ean
01,10.15,Size 12 L
The text was updated successfully, but these errors were encountered: