Page 1 of 1

multibyte bug in @escape:htmlall ?

Posted: Fri Sep 01, 2006 10:52 pm
by sniff
Hi
I've found that there is probably bug in the @escape:htmlall when using multibyte encoding (UTF-8). The text in alert() window is broken. You can see at http://syslog.eu/archives/32-Solaris-Vo ... disku.html by clicking on link "Odezva ze specifického URI na tento záznam"

The code is:
templates/contest/entries.tpl: <a rel="nofollow" style="font-weight: normal" href="{$entry.link_trackback}" onclick="alert('{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape:htmlall}'); return false;" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}" >{$CONST.TRACKBACK_SPECIFIC}</a>

Re: multibyte bug in @escape:htmlall ?

Posted: Sat Sep 02, 2006 12:40 pm
by garvinhicking
Hi!

Yes, you are right - the browsers seem to not copy with HTML entities in the alert() one. Could you try if it works with just "escape:html"?

Sadly this bug would then be in many templates and it's not possible to fix it in the PHP code, but only in the templates. :-/

Regards,
Garvin

Re: multibyte bug in @escape:htmlall ?

Posted: Sat Sep 02, 2006 8:06 pm
by sniff
Hi Garvin!
garvinhicking wrote:the browsers seem to not copy with HTML entities in the alert() one.
I don't think it is a problem of browsers, because word "Kopírovat" in the source code of that page is:

Kopírovat instead of Kopírovat

Which seems to be a problem with wrong multibyte (UTF-8) translating into HTML entities (it outputs 2 chars instead of 1)

Anyway, "escape:html" solves the problem and works fine in my Firefox/Opera/Mozilla browsers.

Vasek