Updating site content type failed infopath 2010 hr

by  |  11-Mar-2015 05:17

It encodes what it can [all of latin1], and the others slip through. I have searched for a function which encodes everything, but in the end I wrote this. Consult an ansii table to custom include/omit chars you want/don't.I'm sure it's not that fast.// Unicode-proof htmlentities.// Returns 'normal' chars as chars and weirdos as numeric html entites.function superentities( $str ){ // get rid of existing entities else double-escape $str = html_entity_decode(stripslashes($str), ENT_QUOTES,'UTF-8'); $ar = preg_split('/(?

If you want to use nl2br on that string afterwards you might end up searching the problem like i did. htmlentities seems to have changed at some point between version 5.1.6 and 5.3.3, such that it now returns an empty string for anything containing a pound sign:$ php -v PHP 5.1.6 (cli) (built: May 22 2008 )$ php -r "echo htmlentities('£hello', null, 'utf-8');"£hello$$ php -v PHP 5.3.3 (cli) (built: Aug 19 2010 )$ php -r "echo htmlentities('£hello', null, 'utf-8');"$(Returns an empty string the second time)Just a heads up.

I use this function to encode all the xml entities and also all the &something; that are not defined in xml like ™ You can also decode what you encode with my decode function. You can also add other string to the array if you want to exclude them from the encoding.

I'm glad 5.4 has xml support, but many of us are working with older installations, some of us still have to use PHP4.

If you're like me you've been frustrated with trying to use htmlentites/htmlspecial chars with xml output.

I was hoping to find an option to force numeric encoding, lacking that, I have written my own xmlencode function, which I now offer: usage: $string xmlencode( $string ) it will use htmlspecialchars for the valid xml entities amp, quote, lt, gt, (apos) and return the numeric entity for all other non alpha-numeric characters.

Community Discussion