Removing / replacing unwanted characters in data

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Removing / replacing unwanted characters in data

Post by Luke »

I've got a client who insists on entering data into their db from word and other places where there are all kinds of funky characters that my website is not properly handling. I do not have access to the server site code, so I cannot really do any kind of fancy character encoding voodoo. I need to be able to correct all of the funky characters before they go into the database. Is there an application or a library or something I can use to filter out or replace all that garbage? Things like Word's special apostrophe character and emdashes and that sort of thing? Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Last I saw they had specific binary data for each of these characters. .. str_replace() should be able to do it quite easily.
Post Reply