rafi73 / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
2 stars 8 forks source link

Sending UTF-8 encoding string with ksoap2 #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Sending a utf-8 string to PHP Webservice ( implement with NuSoap)
2. PHP Webserver receive data and store it to mysql database
3.

What is the expected output? What do you see instead?
It's call success but when i send a utf-8 string to php webservice,it's not 
true:
Ex:
I send:"mưa rồi"
PHP Webservice receive: "m?a r?i"

What version of the product are you using? On what operating system?
KSoap2.5.8 on Win 7 with Android 2.2 + ADT.12

Please provide any additional information below.

Original issue reported on code.google.com by tauit.d...@gmail.com on 23 Oct 2011 at 11:13

GoogleCodeExporter commented 9 years ago
I fixed this problem.
Because HttpTransport set Content-Type is "text/html"
so that i must set it to "text/html;charset=utf-8"
I write a class extends from Transport class
And change a litle bit in public List call(String soapAction, SoapEnvelope 
envelope, List headers)
connection.setRequestProperty("Content-Type", "text/xml;charset=utf-8");

--> Finally. I can send a utf-8 string to server success.

Original comment by tauit.d...@gmail.com on 23 Oct 2011 at 12:38

GoogleCodeExporter commented 9 years ago
Fixed for project in 
https://github.com/mosabua/ksoap2-android/commit/673388f877d5f58e50e6d69b88fddf2
dc729b6c8

will be released with 2.6.0

Original comment by mosa...@gmail.com on 18 Nov 2011 at 4:58