Jump to content

character encoding - how to fix funny chars?


mameha

Recommended Posts

I have a load of data, most of it looks OK but sometimes there are 'funny' characters in there which are causing problems.

 

1) For example when I import data to MySQL from the .sql file, the following character "・" seems to cause mysql to stop importing the field at that point (so all data in the field after that character is lost).  I think that character is supposed to be a double quote, but due to encoding has been changed.

 

2) There are some japanese characters in the text, which surely were not input by the user. For example "GT痴 ".  I think somehow the old system input them like that, or adding them when exporting to me.  How can I get ride of those bad characters?

Link to comment
Share on other sites

use utf8_decode() when inserting into mysql and utf8_decode() when retrieving from mysql

 

ive found that regardless of db encoding and my page's encoding sometimes this goes wrong so for any data that might contain non alphanumeric characters (a-zA-z0-9) i suggest applying the above

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.