[ 
https://issues.apache.org/jira/browse/WICKET-3330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981500#action_12981500
 ] 

Attila Király commented on WICKET-3330:
---------------------------------------

Only slightly related but it seems there is an other inconsistency. Different 
escaping is used when there are field errors and when not.

To reproduce:
Add a string min length validator (with 10 length) to the "field" textfield in 
Péters quickstart
Load up page in browser and type in this (WITH quotes): 'áé<&>' (its short only 
7 chars) and post.
Note that now the "áé" characters will not get escaped but the other characters 
will. If you send more than 10 characters everything will be escaped as in the 
original example.

The reasons seems to be in markup.html.form.FormComponent.getValue(): there is 
an if that is based on the errors in some way.
If there was an error Strings.escapeMarkup(rawInput) (its like 
Strings.escapeMarkup(rawInput, false, false)) is called.
If there was no error Strings.escapeMarkup(modelString, false, true) is called 
in Component.getDefaultModelObjectAsString(Object).
That last boolean parameter decides if unicode characters need escaping or not. 
Next to disabling model string escaping by default this should be fixed too (I 
am for not escaping unicode parameters).

> TextField shows HTML entities instead of UTF-8 characters
> ---------------------------------------------------------
>
>                 Key: WICKET-3330
>                 URL: https://issues.apache.org/jira/browse/WICKET-3330
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC1
>            Reporter: Major Peter
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3330.patch, wicket-3330.tar.gz
>
>
> It looks like that for some reason now the TextFields (at least, could be 
> other FormComponents too) shows HTML entities instead of UTF-8 characters. 
> See the attached quickstart for example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to