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

Jon Daley plogworld at jon.limedaley.com
Mon Mar 12 10:05:45 EDT 2007


 	Could we have an if(locale == CJK) or something to get around it 
for now?  I think Oscar wants to release 1.2 now, and I don't think we 
should release it with the HTML_ENTITES not being escaped - people will 
see it as something breaking in 1.2, since it worked in 1.1.5.
 	And presumably, you wouldn't want to see it released with 
HTML_ENTITIES being escaped -- which, by the way - have you (or whoever 
found this problem) not upgraded to 1.1.5?

On Mon, 12 Mar 2007, Mark Wu wrote:

> Hi Jon:
>
> No idea :(
>
> I have to test those translation table elements one by one. :(
>
> 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:40 PM
>> To: plog-svn at devel.lifetype.net
>> Subject: Re: [pLog-svn] r5062 - plog/branches/lifetype-1.2/class/data
>>
>>  	Do you know which ones break CJK?  Is it a problem of
>> this function being an 8 bit function, and CJK is 16, so it
>> is incorrectly seeing part of a two-byte code as an
>> HTML_ENTITY, when really the character is a completely
>> unrelated character?
>>
>> On Mon, 12 Mar 2007, Mark Wu wrote:
>>
>>> 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
>>>>
>>>
>>> _______________________________________________
>>> pLog-svn mailing list
>>> pLog-svn at devel.lifetype.net
>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>
>>
>> --
>> Jon Daley
>> http://jon.limedaley.com/
>>
>> MS-DOS: Just say "no"
>> -- David Yolt
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://limedaley.com/mailman/listinfo/plog-svn
>>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>

-- 
Jon Daley
http://jon.limedaley.com/

Never put off until tomorrow what you can do the day after tomorrow.
-- Mark Twain


More information about the pLog-svn mailing list