hi all,
i am working on an application supporting Chinese and have been
puzzled by a encoding error.i really really hope someone here could
help me out of this sucking problem...:(
i take a Chinese string from an EditText and append it to a URL which
goes like "?Owner=XXX". i am trying to send this URL using UTF-8.
the following is what i have done:
a) i get the string "ownerName"(containing Chinese characters)
b) String tmp = new String(Owner.getBytes("UTF-8"), "UTF-8");
c) urlString = urlBase + tmp
d) URL url = new URL(urlString);
e) InputStream is = url.openStream();
... ...

when i check the encoded byte[] array, everything seems alright. but
the byte[] array which server gets is quite wrong (always stuff like
"1a1a").
i tried the exact request string with the exact byte array in a java
applet, the server works.
so i really don't know what on earth is going wrong.

Could anyone help? Many thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to