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
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?

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.