Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTML-FormHandler CPAN distribution.

Report information
The Basics
Id: 55640
Status: resolved
Priority: 0/
Queue: HTML-FormHandler

People
Owner: Nobody in particular
Requestors: KAPPA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.30003
Fixed in: (no value)



Subject: Simple renderers break on non-ascii characters (but in non-fatal way)
Simple renderers (both ::Render::Simple and ::Widget family of roles) use HTML::Entities::encode_entities() which by default tries to encode all non-ascii characters into named entities. Not only it is slow and unnecessary but it also breaks multi-byte data as it encodes octets which are actually a single character separately. Browsers never combine them back. Simple fix is to use two argument version of encode_entities($str, q{"'<>&}) to only encode unsafe characters. Using a series of s/// operations will be faster, btw.
I've switched to using a customizable filter that uses perl to convert just the basic ",&,<,>. There's a new attribute 'render_filter' that takes a coderef. Tests in t/render_filter. Modified Render::Simple and the widgets to use the new filter. In repository, will be in new release soon.