Jump to content

Character encoding problem


dc_jt

Recommended Posts

Hi

 

I have recently imported a lot of data into my database, however a lot of the content contains characters such as � and ¿½ etc. These seem to be the apostrophes and speech marks. I have tried using a str_replace to replace them with the correct html for an apostrophe or a speech mark but it doesnt seem to work. Any ideas what I can do?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/153327-character-encoding-problem/
Share on other sites

You can try converting the tables to utf8_bin... Also make sure you are using a UTF8 connection, this provides the broadest range of character support.

 

Thanks but im not quite sure how I would do this? Would I have to re-import the data? Is there anyway I can simply encode the characters on the front end when I echo it out?

Sounds like you've got Microsoft's "smart quotes syndrome" :D

 

Using Google you can find quite a few scripts to go through and replace all these codes with proper characters. I recall a similar problem a while back on here and some handy code was posted - try searching for it ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.