[pLog-svn] r5062 - plog/branches/lifetype-1.2/class/data

Mark Wu markplace at gmail.com
Mon Mar 12 09:36:06 EDT 2007


Hi Jon:

No idea how it can be done. Maybe we can get translation table through
HTML_ENTITIES, but remove those translation element we don't want.

Just a idea.

Mark

> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net 
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
> Sent: Monday, March 12, 2007 9:19 PM
> To: plog-svn at devel.lifetype.net
> Subject: Re: [pLog-svn] r5062 - plog/branches/lifetype-1.2/class/data
> 
> I thought this might have been my original change, so I looked it up.
> HTML_ENTITES breaks something in the CJK environment?  Is 
> there a way we can get this function to translate 
> HTML_ENTITIES without breaking CJK?  We need to convert more 
> than just SPECIAL_CHARS and the single quote.
> 
> 
> ----------------------------------------------------
> r4591 | jondaley | 2007-01-27 10:55:28 -0500 (Sat, 27 Jan 
> 2007) | 1 line I think this function wasn't doing what people 
> thought it was.  It now translates all html entities (most 
> notable  ), instead of just a handful.
> ----------------------------------------------------
> function htmlDecode( $htmlString, $quote_style = ENT_QUOTES ){
> - $trans_table = 
> array_flip(get_html_translation_table(HTML_SPECIALCHARS, 
> $quote_style));
> - $trans_table['''] = "'";
> - return( strtr( $htmlString, $trans_table ));
> 
> + // replace numeric entities
> + $htmlString = preg_replace('~&#x([0-9a-f]+);~ei', 
> + 'chr(hexdec("\\1"))', $htmlString); $htmlString = 
> + preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $htmlString); // replace 
> + literal entities $trans_tbl = 
> + get_html_translation_table(HTML_ENTITIES);
> + $trans_tbl = array_flip($trans_tbl);
> + return strtr($htmlString, $trans_tbl);
> ----------------------------------------------------
> 
> 
> 
> On Mon, 12 Mar 2007, Oscar Renalias wrote:
> > Did you find the reason why and who made this change? It would be 
> > worth checking before reverting the changes...
> 
> >> -            $trans_tbl = 
> get_html_translation_table(HTML_ENTITIES);
> 
> >> +            $trans_tbl = get_html_translation_table( 
> HTML_SPECIALCHARS, $quote_style );
> >> +            $trans_tbl['''] = "'";
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
> 



More information about the pLog-svn mailing list