getValue cannot read 'umlaut'

May 14, 2010 at 8:22 AM

Hello,

 

I'm trying to export some Excel data into php; for this I use your function "$objWorksheet->getCellByColumnAndRow($col, $row)->getValue()"

But any German umlaut are scrambled :-(

But when I try to directly export the xls to html, the correct names are written! "$objWriter->save(str_replace('.php', '.htm', __FILE__));"

 

Thanks in advance,

Hotshot

Coordinator
May 14, 2010 at 8:32 AM
On 14/05/2010 09:22, hotshot2 wrote:
>
> I'm trying to export some Excel data into php; for this I use your
> function "$objWorksheet->getCellByColumnAndRow($col, $row)->getValue()"
>
> But any German umlaut are scrambled :-(
>
> But when I try to directly export the xls to html, the correct names
> are written! "$objWriter->save(str_replace('.php', '.htm', __FILE__));"
>
If you consistently use UTF-8, you should have no issues with characters
like umlauts.... You're reading the data from the excel worksheet... how
are you determining that it's scrambled? echoing it to a browser? check
the character encoding that you're using for the browser page.
May 14, 2010 at 9:00 AM

Ok, that was the problem... I used the "iso-8859-1" charset; now that I changed that to "utf-8", it's displayed correctly. I don't really care but I do wonder why I need to specify utf-8 as the encoding type?

 

Anyway: thanks for your fast reply! *thumbs up*