henkmahendra / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

Character encoding issues #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The HTML dump of the attached Excel file does not properly show either the
Russian text, or the Spanish text. 

Two issues: an htmlentities() is done in dump(), regardless of string
encoding. Attached patch uses defaultEncoding as parameter for htmlentities.

The other issue is (from reading the Excel specs @openoffice.org) that what
is called asciiEncoding in the code, is actually compressed UTF-16LE (i.e.,
all high bytes stripped). The compressed string is usually ASCII for
regular characters, but not for accented characters. In the current
version, asciiEncoding strings are not encoded to the defaultEncoding,
thereby leaving the accented characters untranslated. Attached patch
re-inserts all high byte zeros, and always call encodeUTF16.

With these patches, the attached file displays properly in HTML, and the
example.xls from the source code also still seems to work.

PS: a big thank you for this library - we've been messing with the old one
for way too long over here :-)

Original issue reported on code.google.com by her...@ozuzo.net on 11 Jun 2009 at 7:02

Attachments:

GoogleCodeExporter commented 9 years ago
This should cover issues #8, #18 and #19 as well.

Original comment by her...@ozuzo.net on 11 Jun 2009 at 8:09

GoogleCodeExporter commented 9 years ago
Hello,
Can you please explain how can i implement your patch with the original php 
excel
reader class.

Thank you

Original comment by amour...@gmail.com on 22 Jul 2009 at 2:30

GoogleCodeExporter commented 9 years ago
Hi amouri82!
I've applied the patch for you.
See in attach.

Original comment by ruber...@gmail.com on 31 Jul 2009 at 10:00

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch, worked perfectly!!

Original comment by gustavo....@gmail.com on 31 Jul 2009 at 10:40

GoogleCodeExporter commented 9 years ago
Thanks for this patch, you saved me a half of a day :) (first half spent on 
working
out myself :)

Original comment by grafik.h...@gmail.com on 18 Sep 2009 at 2:06

GoogleCodeExporter commented 9 years ago
Man you saved my life!

<3

Original comment by alejandr...@gmail.com on 8 Oct 2009 at 7:47

GoogleCodeExporter commented 9 years ago
man you saved my life!

<3

Original comment by alejandr...@gmail.com on 8 Oct 2009 at 7:58

GoogleCodeExporter commented 9 years ago
This made my day! :o) thx a lot!

Original comment by fiedler....@gmail.com on 30 Nov 2009 at 3:04

GoogleCodeExporter commented 9 years ago
At first, i still wondering how to convert those special char, finial i find 
your
post. Thx a lot, Great job

Original comment by ypang.y...@gmail.com on 24 Dec 2009 at 4:55

GoogleCodeExporter commented 9 years ago
((((
тест�     круто�

Original comment by chilatse...@gmail.com on 14 Jan 2010 at 8:18

GoogleCodeExporter commented 9 years ago
Included at version 2.22 at:
http://code.google.com/p/php-excel-reader2/

Original comment by sirsh...@gmail.com on 19 Jan 2010 at 12:54

GoogleCodeExporter commented 9 years ago
New PHP version not tolerated this(5.3.x):
line 917 $this->_ole =& new OLERead();

change this line
 $this->_ole = new OLERead();
And no more warning.

Original comment by 01xcvxcv...@gmail.com on 27 Jul 2010 at 4:47

GoogleCodeExporter commented 9 years ago
Hi!

Thank you very much!!! It was very helpful!

Original comment by aen...@gmail.com on 8 Aug 2010 at 1:10