views:

85

answers:

1

Hello,

I am having issues correcting an encoding type issue on a site. Unfortunately the site is non work safe (gay porn).

For the brave: SNIP

Ive tried setting the meta content from utf8 to iso-8859-1.

Ive switched tables over to utf8 from latin1_swedish_ci but no luck.

EDIT Note very pretty, but I exported everything into a text file and then did a find replace for ' to the correct comma (with a slash) and then imported it back into the database.

From now on the forms will be submitting UTF8 encoded text so it shant be an issue :)

+2  A: 

To the point, you at least need to ensure that everything is using the one and the same correct encoding. HTTP GET/POST requests and HTTP responses should be parsed/sent with the same encoding. The client should be instructed to use the same encoding. The source files itself should be saved in the same encoding. The database should store the data using the same encoding. The database should be instructed to transfer data in the same encoding. The programming language should be instructed to handle data in the same encoding.

To prepare world domination, I recommend to pick UTF-8.

I see that the site is using Apache/PHP. The following links may be useful then: How to setup your PHP site to use UTF8.

More background information about the world of encodings can be read in this article of our Joel: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!).

BalusC
I have chosen UTF8. I have followed the instructions on that page but I still don't see the ' character.Im in the process of writing a script to loop all the main content and use PHP's utf8_encode function.Strange results here and there and still not the desired result.
azz0r
It would be helpful to inform us about where those characters originate. A database? A textfile? The source code? Does each of them look fine when opened/viewed with an independent tool? It would also be helpful to know what encoding the client was instructed to display the characters. In Firefox you can check it by *View > Character Encoding*. You can configure that by altering the `Content-Type` header, either programmatically using `header()` function in PHP or statically using `<meta>` tag in HTML.
BalusC