On Jan 28, 4:05 pm, googelybear <[email protected]> wrote:
> Hi,
>
> My problem is very simple (I think):I have a string and would like to
> encode it in utf-8 (so I can send it to a server). Example: "ü"
> becomes "&#252;"

This is not "utf-8", that's "HTML character reference" or "XML
character reference"

> Someone pointed out to use com.google.gwt.http.client.URL.encode
> (myString) but this will not yield the correct result (e.g. "ü"
> becomes %C3%BC which is not corretctly interpreted by my server).
>
> Does anyone have another idea how to accomplish this task? Or do Ihave
> to resort to javascript magic?

Why cannot you send your string "as-is"?

The only "magic" is that browser's XMLHttpRequest (used in GWT's
RequestBuilder and GWT-RPC) will use UTF-8 to encode request's "body";
but that's not really "magic", they could have chosen another encoding
provided they communicate it to the server in the Content-Type header.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to