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

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

You have to specify the character encoding of the script file in the script tag 
with the charset attribute [1] if it differs from the page encoding. For 
example if I modify wicket to render all script tags with charset="UTF-8" 
attribute sour quickstart starts working.

Imho wicket has no way to figure out the encoding of js files but maybe 
o.a.w.markup.html.IHeaderResponse.renderJavaScript* methods could be enhanced 
with an optionl charset attribute to handle cases like this.

[1] W3School script@charset: 
http://www.w3schools.com/tags/att_script_charset.asp

> Encoding problem with JavaScriptRefrences
> -----------------------------------------
>
>                 Key: WICKET-3909
>                 URL: https://issues.apache.org/jira/browse/WICKET-3909
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC5.1
>            Reporter: Bálint Kriván
>              Labels: ajax, encoding, javascript
>         Attachments: myproject.tar.gz
>
>
> Let we have a javascript which contains some strings (which eventually should 
> be appended to DOM), and let we have a page in different encoding from UTF-8, 
> like ISO-8859-2. The anomaly is the following:
> * If the encoding of the JS is UTF-8, then the Ajax query which injects the 
> JS is working OK. The injected string looks like it should be, no magic 
> chars. But if we don't use the JS from Ajax, but plain request, then the 
> string is ugly because JS is in UTF-8, but the page is in ISO-8859-2.
> * If the encoding of the JS is the same as the Page then the response of the 
> Ajax request will be ugly, but the plain non-ajax will be OK.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to