【发布时间】:2013-05-16 12:53:03
【问题描述】:
请帮忙,我必须将来自数据库(oracle 存储过程 => 映射到 java 对象)的 unicode 字符串打印到 JSP 页面(使用 stuts1)中,我使用了这个:
String unicodeStr = myBean.getTitle();//return from database the unicode string (something like this : Uygulama g\u00fcvenli\u011fi ile).
String isoString = org.apache.commons.lang.StringEscapeUtils.escapeHtml(unicodeStr);
我的问题是unicodeStr 为每个"\" (Uygulama g\\u00fcvenli\\u011fi ile) 都附带了"\\",所以我的StringEscapeUtils.escapeHtml 无法检测到像"\u00fc" 这样的unicode 字符,因为开头的"\"。
我试过unicodeStr.replaceAll("\\","\"),但它无法编译,因为"\"不允许在没有转义的字符串中。
【问题讨论】:
-
这个“ISO”是什么东西?