String charsets in GWT client code

51 views
Skip to first unread message

vmnikulin

unread,
Dec 13, 2011, 2:35:46 PM12/13/11
to Google Web Toolkit
Hi all!

The document http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
says that the GWT supports constructor String(byte[] bytes, String
charsetName) .
But when I try to use it with charset Windows-1251 (cp866 etc - this
charsets include non-ASCII symbols) in production mode on tomcat, I
get JS exception.

What is it?

Thanks in advance.

Thomas Broyer

unread,
Dec 14, 2011, 4:53:31 AM12/14/11
to google-we...@googlegroups.com
The only supported charsets are UTF-8 and ISO-8859-1.

new String(new byte[] { 0xC3, 0xA9 }, "UTF-8") => "é"
new String(new byte[] { 0xE9 }, "ISO-8859-1") => "é"

vmnikulin

unread,
Dec 14, 2011, 5:29:16 AM12/14/11
to Google Web Toolkit
Thank you, Thomas.

http://www.google.com/url?sa=D&q=http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/super/com/google/gwt/emul/java/lang/String.java%23304&usg=AFQjCNHIZskMG6PXNz1JAwNxsuzkOZQcdA
javaDoc is very useful.

On 14 дек, 16:53, Thomas Broyer <t.bro...@gmail.com> wrote:
> The only supported charsets are UTF-8 and ISO-8859-1.
>
> new String(new byte[] { 0xC3, 0xA9 }, "UTF-8") => "é"
> new String(new byte[] { 0xE9 }, "ISO-8859-1") => "é"
>

> Seehttp://code.google.com/p/google-web-toolkit/source/browse/trunk/user/...

Reply all
Reply to author
Forward
0 new messages