goodcui / owaspantisamy

Automatically exported from code.google.com/p/owaspantisamy
0 stars 0 forks source link

Internationalization Issue #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using the sample war (AntiSamyDemoWebApp.war)
2. Enter å to be validated
3. Select any of the policies (exception NO POLICY) 

What is the expected output? What do you see instead?
Except: å
Get: å

What version of the product are you using? On what operating system?
1.3 AntiSamyDemoWebApp.war

Please provide any additional information below.

If I make the following changes the index.jsp page:
Add  contentType="text/html;charset=UTF-8" to the page declaration.
Resulting in <%@ page language="java" contentType="text/html;charset=UTF-8"%>

Add the code request.setCharacterEncoding("UTF-8"); at the beginning of the
first code block

Change the form to POST rather then GET.

Then I get the results I expect, however if I then but in invalid html (<a
hre="dfhads">å</a>) and use the Chinese language the Chinese character do
not come through correctly.

I get: æ
‡è®°a包含一个没法处理的属性ã€�
�属性hre已被过滤,但æ 
‡è®°ä¿å­˜ä¸å˜ã€‚

I would expect: 
标记a包含一个没法处理的属性。属性hre已被过滤,但标记保�
��不变。

Original issue reported on code.google.com by Alan.Olm...@gmail.com on 13 Jul 2009 at 6:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Replace string inside "index.jsp":
String profile = request.getParameter("profile");

by:
String profile = new 
String(request.getParameter("profile").getBytes("ISO-8859-1"),
"UTF-8");

There is no charset encoding problems inside AntiSamy. Problems relate to 
encoding
mess within Server/JSP. The same old song...

See
http://stackoverflow.com/questions/138948/how-to-get-utf-8-working-in-java-webap
ps

Original comment by xyyzz...@gmail.com on 21 Jul 2009 at 8:20

GoogleCodeExporter commented 9 years ago
Agreed with commenter.

Original comment by arshan.d...@gmail.com on 3 Aug 2009 at 2:31