在GWT中使用UTF-8编码字符串 [英] Encode String with UTF-8 in GWT

查看:123
本文介绍了在GWT中使用UTF-8编码字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在GWT中用UTF-8编码一个String?换句话说,是否存在一个与java.net.URLEncoder.encode(toEncode,UTF-8)等价的GWT兼容?

Is there a way to encode a String with UTF-8 in GWT? In other words, is there a GWT-compatible equivalent to java.net.URLEncoder.encode(toEncode, "UTF-8")?

推荐答案

是的,它是com.google.gwt.http.client.Url.encode(),JavaDoc: http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/http/client/ URL.html

Yes, it's com.google.gwt.http.client.Url.encode(), JavaDoc: http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/http/client/URL.html

这篇关于在GWT中使用UTF-8编码字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆