[wp-hackers] wp>insert fails

Haluk Karamete halukkaramete at gmail.com
Mon Apr 30 20:47:18 UTC 2012


In the process of bringing/migrating some 50,000 (post-like) records
from microsoft sql into wp, I run into mysql insert errors. Some weird
characters here and there create a mysql error. that  happens in maybe
0.55 of the whole recordset. To skip those records and move on with
the migration, I had to put an @ sign in front of the insert statement
so PHP does not stop for the error. But I do not want to completely
ignore those 0.5%.

What character filtering technique do I use to take the post content
as is  - simply ignoring those weird characters if any?
Those characters could be rangin from smart quotes to some weird
french or poland characters that somehow has a problem with
wp/mysql/insert operation?

Is there a "filter_to_utf8" function or something to that effect?


More information about the wp-hackers mailing list