jasonrogena / jasonrogena/php-excel-reader

Wrong Encoding for values

Open
#8 1 comment 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
In version 2.11, the line 771 decides whether or not a string is ascii
encoded or not. As it seems this is not working reliably, for only UTF16LE
strings are "decoded" to the requested defaultEncoding.

My workaround/hack for now is to replace line 771 with this:

$retstr = ($asciiEncoding) ? iconv('cp1250', $this->_defaultEncoding,
$retstr) : $this->_encodeUTF16($retstr);

I'm not fully convinced using an hardcoded encoding of cp1250 is a good
idea but it seems to work in my testcase.

```

Original issue reported on code.google.com by `arne.bla...@gmail.com` on 4 Feb 2009 at 10:24

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting line 771 in version 2.11 and reproduce the reported behavior with UTF16LE strings and the requested defaultEncoding. Compare that behavior with the reported cp1250 workaround; done means the encoding conversion works reliably without relying on an unverified hardcoded encoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.