You are not logged in.

#1 2010-07-02 11:48:18

XAM
Member
Registered: 2009-12-31
Posts: 12

Unable to set Default charset to UTF-8

So I've added the following to /etc/httpd/conf/httpd.conf:

AddDefaultCharset utf-8

Still firefox reports that my phpfiles are using ISO-8859-1 even though defaulcharset and the files encoding is utf-8.

What am I doing wrong? I converted the file to UTF-8 with notepad++.

Problem is that Å Ä Ö don't work properly. They never work when echoed from mysql.

Last edited by XAM (2010-07-02 11:49:19)

Offline

#2 2010-07-02 12:19:25

Banton
Member
Registered: 2010-05-28
Posts: 67

Re: Unable to set Default charset to UTF-8

Have you set <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in html header?

Offline

#3 2010-07-02 14:21:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to set Default charset to UTF-8

> They never work when echoed from mysql.
Are the files generated dynamically? If so, you should check the mysql part.

Offline

#4 2010-07-02 19:09:55

XAM
Member
Registered: 2009-12-31
Posts: 12

Re: Unable to set Default charset to UTF-8

Banton wrote:

Have you set <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in html header?

Yes, but I've created a phpfile with the following code, nothing else is in the file.

<?php echo'Å Ä Ö'; ?>

Does not work, it echoes out wierd characters.

karol wrote:

> They never work when echoed from mysql.
Are the files generated dynamically? If so, you should check the mysql part.

mysql is set to utf-8.

Offline

#5 2010-07-04 02:59:19

XAM
Member
Registered: 2009-12-31
Posts: 12

Re: Unable to set Default charset to UTF-8

So I've got Å Ä Ö working inside apache now. But they still look wierd when echoed from mysql.
I've setup my database to utf8_general_ci, did not work.

Any ideas?

Offline

#6 2010-07-04 03:12:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to set Default charset to UTF-8

Did you ask mysql / php gurus for help? I've seen a bunch of similar threads some time ago:
http://stackoverflow.com/questions/1317 … y-php-apps

Offline

Board footer

Powered by FluxBB