Replacing Word special characters on output?

2009-01-22 Thread Jeff F
Data is cut-pasted from Word (I think), then inputted via form text area to database. When outputting data, some characters such as apostrophies and dashes display as little squares. I need to fix this somehow. First thought is to replace the characters on output, but I don't even know what

Re: Replacing Word special characters on output?

2009-01-22 Thread Charlie Griefer
cflib has a function called demoronize. some rich text editors have a special paste from Word button that attempt to clean up the smart quotes and other crappy MS characters. however, it's been my experience that neither these (nor any other automated method that I've heard of) is bulletproof.

Re: Replacing Word special characters on output?

2009-01-22 Thread Jeff F
Thanks Charlie, I just tried DeMoronize, and it did not even touch it. Worth a try though. I wish there was something effective. I get people cutting-pasting from Word, Publisher, all sorts of programs always with problems. I always suggest pasting in MS Notepad first to clean it up, but the

Re: Replacing Word special characters on output?

2009-01-22 Thread Claude Schneegans
Personally I use this function which also replace HTML codes by true iso characters (HTML codes cause search requests to fail): function toIso(text) { var html = ##201;,aacute;,agrave;,acirc;,aelig;,aring;,atilde;,auml;, eacute;,egrave;,euml;,ecirc;,iacute;,igrave;,iuml;,icirc;,

Re: Replacing Word special characters on output?

2009-01-22 Thread Jason Fisher
I've often thought about pulling apart the JavaScript that's in use by tinyMCE or fckEditor and building a server-side filter to get content into the DB clean, but I haven't found the time. May be worth a look. They're open source, so dig through the editor functions to find the cleanWord()