ijoenk19 / 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 8 years ago

GoogleCodeExporter commented 8 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 8 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 8 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 8 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 8 years ago
Thanks for the patch, worked perfectly!!

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

GoogleCodeExporter commented 8 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 8 years ago
Man you saved my life!

<3

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

GoogleCodeExporter commented 8 years ago
man you saved my life!

<3

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

GoogleCodeExporter commented 8 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 8 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 8 years ago
((((
тест�     круто�

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

GoogleCodeExporter commented 8 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 8 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 8 years ago
Hi!

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

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

GoogleCodeExporter commented 8 years ago
Thanks! A great fix.

Original comment by torgny.a...@gmail.com on 31 Aug 2010 at 1:12

GoogleCodeExporter commented 8 years ago
Thanks!! 

Original comment by iltuoami...@gmail.com on 16 Sep 2010 at 11:23

GoogleCodeExporter commented 8 years ago
Thank you man!

Original comment by rossen.z...@gmail.com on 2 Nov 2010 at 5:10

GoogleCodeExporter commented 8 years ago
You made my day :)

Working on this all day long, and finally just before going home : this Post.

Thanks!!!

Original comment by loic.tau...@gmail.com on 9 Nov 2010 at 3:55

GoogleCodeExporter commented 8 years ago
Oh! Thanks a lot!
Все отлично работает!!! =)

Original comment by nelson.n...@gmail.com on 19 Nov 2010 at 5:51

GoogleCodeExporter commented 8 years ago
Thanks Mann :)
This works ;)

Original comment by TeknoSe...@gmail.com on 4 Mar 2011 at 4:13

GoogleCodeExporter commented 8 years ago
Thanks for this patch, worked smooth jus by replacind the downloaded file.

Original comment by mmuci...@gmail.com on 22 May 2011 at 2:11

GoogleCodeExporter commented 8 years ago
Thanks for this patch, it works perfectly :)

Original comment by nguyentienlong88@gmail.com on 1 Aug 2011 at 6:50

GoogleCodeExporter commented 8 years ago
Thanks for this patch, it works Turkish characters to.

Original comment by ozay.ozd...@gmail.com on 9 Sep 2011 at 11:30

GoogleCodeExporter commented 8 years ago
THANK YOU (I normally don't type in CAPS, but after hours trying everything in 
the book, I finally found this..)

Original comment by tomherm...@gmail.com on 28 Sep 2011 at 4:21

GoogleCodeExporter commented 8 years ago
Just find a line:

$val = htmlentities($val);

and replace it with:

$val = htmlentities($val, ENT_COMPAT, $this->_defaultEncoding);

This corrects the encoding using dump() method, as the val() seems to be 
working fine. Make sure to use setOutputEncoding() or define encoding when 
constructing the class

Original comment by marcin.k...@gmail.com on 19 Jan 2012 at 11:49

GoogleCodeExporter commented 8 years ago
God bless you for this patch! :)

Original comment by jan.kriz...@gmail.com on 29 Mar 2012 at 6:14

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
hi
    i have test with below specifications.

    PHP: 5.2.9
    Version 1.7.1

PHP Version 5.2.9

System  Windows NT SYSTEM10 5.1 build 2600

Original comment by abtrajut...@gmail.com on 21 Jun 2012 at 5:10

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thanks. you saved my job. I think it's time to change the split function to 
explode, because it has been  DEPRECATED.

Original comment by vladart...@gmail.com on 3 Aug 2012 at 12:54

GoogleCodeExporter commented 8 years ago
Sorry, but i have error. 
May be you say why?
upload new file and have "Fatal error: Call to undefined method 
Spreadsheet_Excel_Reader::dump_clean() in 
/var/www/vhosts/u1912784........./plugins/excel-to-table/excel-2-table.php on 
line 19"

help! 

Original comment by A23...@gmail.com on 10 Apr 2013 at 2:20

GoogleCodeExporter commented 8 years ago
the fix for issue #31 helped big time. thanks!

Original comment by dha...@gmail.com on 26 Apr 2013 at 6:27

GoogleCodeExporter commented 8 years ago
thank a lot

Original comment by mana.att...@gmail.com on 21 Aug 2014 at 6:06

GoogleCodeExporter commented 8 years ago
i'm still error 
my output error : Trung tâm Viá»…n thông IP

Original comment by hongtham...@gmail.com on 3 Mar 2015 at 10:00

Attachments: