Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

>>重定向不支持中文 #883

Closed
enzozhong opened this issue Jun 25, 2015 · 3 comments
Closed

>>重定向不支持中文 #883

enzozhong opened this issue Jun 25, 2015 · 3 comments
Assignees
Milestone

Comments

@enzozhong
Copy link
Contributor

src= /i/2015/6/测试-888x666.jpg
@ok ( ">>:${obj.pic.src}" )
浏览器url成 /i/2015/6/??-888x666.jpg

若改成
@ok ( "->:${obj.pic.src}" )
报错页面,能识别为
/i/2015/6/测试-888x666.jpg

环境tomcat 已经加上了URIEncoding="UTF=8"

@enzozhong
Copy link
Contributor Author

解决办法
String path = pic.src.trim ();
path = new String ( path.getBytes ( "UTF-8" ) , "ISO8859_1" );

response.sendRedirect ( path );

@wendal wendal closed this as completed in 7d52ffa Jun 28, 2015
@wendal
Copy link
Member

wendal commented Jun 28, 2015

添加了一个urlencode, 需要转换的字符串, 用

@Ok(">>:xxxx.xxx/xx/xxx/${urlencode(obj.pic.src)}")

@wendal wendal reopened this Jun 28, 2015
@wendal wendal closed this as completed Jun 28, 2015
@wendal wendal added this to the 1.b.53 milestone Jun 28, 2015
@wendal wendal self-assigned this Jun 28, 2015
@juqkai
Copy link
Member

juqkai commented Aug 19, 2019

建议redirect那里改一下文档

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants