I'm trying to send user name with libgdx's input textfield. It works fine with normal characters, i can send it to php and save it into database. But when i try special turkish characters like "ö,ş,ğ,ç,ü" etc. it doesn't send those characters and the characters after them. And additionaly special caharacters can be seen in textfield, but not sending them to php file.
I saw a post about this problem, here, and i've updated libgdx version to the latest stable one. But still i'm having the same problem.
The code i'm using is below:
HttpRequest request = new HttpRequest(HttpMethods.POST);
request.setUrl("http://xxxxx.com/create_usr.php");
request.setContent("name=" + name);
Do i have to add something more to this http code for sending those characters?
Additionally i've seen some extra code on net, i don't know what they do but i've added them before seturl, but didn't work:
request.setHeader("Accept-Charset", "utf-8");
request.setHeader("Content-Type", "application/x-www-form-urlencoded");
SOLVED:
I've changed the httprequest part with the code below and it worked. I've also changed the post method to get:
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("name", name);
HttpRequest request = new HttpRequest(HttpMethods.GET);
request.setUrl("http://xxxxx.com/create_usr.php"");
request.setContent(HttpParametersUtils.convertHttpParameters(parameters));