Special characters not displayed correctly in excel

Hi All,

I put my project on server and when I try to export the CGridView in excel (using tlbexcelview ext) some special characters (german umlaut) are not displayed correctly…

In my localhost everything works fine…

This problem happens only in server.

Any idea where is the problem?

Thank you in advance.

I don’t know if this will work, but you can try to add these lines to htaccess:




# Redirect non-www urls to www

RewriteEngine on

RewriteCond %{HTTP_HOST} ^example\.com [NC]

RewriteRule (.*) http://www.example.com/$1 [R=301,L] 

@moginn

How can this help?

@erand

Do you have proper encoding there? Is your localhost version using the same DB connection if any?

could be encoding issue make sure you have page set to utf-8 also check if the library has support utf-8

I just tried from my localhost using the same db the server is using, and when export to excel everything is fine…

Only from server the excel shows strange characters! The thing is that CGridView (in server) is showing the correct characters (from db), only when exporting to excel the encoding is not working…

Well, the library is working fine from localhost…and I also just tried in both cases using the same db connection and still from server it is not working…

Ok, it is fixed!

I installed php_mbstring.dll (cause it was needed for some pdf library).

Apparently that also fixed the excel issue!

Thank you all for your time/help :)

I once had an encoding problem and I remember that, after putting this code, the problem disappeared. However, I am not sure if the problem disappeared thanks to this code.