[nycphp-talk] Converting the pesky MS Word quotes and other characters
Michael Southwell
michael.southwell at nyphp.com
Wed Oct 29 22:58:41 EDT 2008
Hans Zaunere wrote:
>> Has anyone on here found a viable solution? Everything seems to work
>> on the www side of things but as soon as i use the data in an RSS feed
>> it does not seem to like the MS Word characters.
>
> Word/etc always manages to create new and exciting chars, but the following
> usually take care of most of them.
>
> $this->Value = str_replace(array(chr(0x92),chr(0x93),
> chr(0x94),chr(0x96),chr(0x97),chr(0x85)),
> array('\'','"','"','-','-','...'),$this->Value);
I would add to this the following:
chr(0x91) -> '’' [backtick]
chr(0xa0) -> ' ' [space]
--
=================
Michael Southwell
Vice President, Education
NYPHP TRAINING: http://nyphp.com/Training/Indepth
More information about the talk
mailing list