I am working on my android project. I have to send some words to the server application via my android application. After I send them, I will able to search some surveys and return them to the clients. My users use "Persian" characters to search their appropriate subjects.
I found that when i send them (persian wordsفارسی
) to the server, it can't recognize them correctly. it works on a stream of " ???? " instead of correct words. It just has this problem with Persian words which are sent from android app not English words. I have never tried other languages but I think it also has this problem with them. I think the mobile device has different code for Persian characters & the C# code which is placed in the server cant translate the Persian words. Let me tell you that I use C# for implementing server side and Java for the android application & the data base is SQL server 2010.
I use query string to catch the parameter. After that I use this parameter to make a query which returns subjects from DB. C#:
string Tag = Request.QueryString["Tag"].ToString();
Java:
this part shows how I send my parameter to the server. I think this is an usual way for sending parameters via HTTP protocol.
HttpURLConnection urlConnection = null;
try{
URL myUrl=new URL("http://10.0.2.2:80/Urgence/SearchResault.aspx?Tag="+Tag);
urlConnection = (HttpURLConnection)myUrl.openConnection();
BufferedReader in = new BufferedReader (new InputStreamReader(urlConnection.getInputStream()));
String temp="";
// Data is used to store Server's Response
while((temp=in.readLine())!=null)
{
Data=Data+temp;
}
}
How should I solve my problem?