0
4

3 回答 3

1

You should specify the encoding in the android code:

httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

Otherwise it will be ISO-8859-1.

On the PHP side, do not do any conversion such as utf8_decode/encode, these will always just make it worse.

Also fix your http header:

<?php
header('Content-Type: application/json; charset=utf-8');
print_r($_POST);
于 2013-01-05T11:41:59.693 回答
0

Why don't you try to transform it into html sign? Like $#numbers;. If not than state encoding like utf-8 general_ci or ANSI. it helped me once.

于 2013-01-04T20:20:47.637 回答
0

Just for your curiosity... i finally fix the problem. I miss to add th charset the db have to use so i put:
$conn = oci_new_connect($userDb, $pswDB, $urlDb, 'AL32UTF8');
instead
$conn = oci_new_connect($userDb, $pswDB, $urlDb);

So Android have:
httpPost.setEntity(new UrlEncodedFormEntity(params, "utf-8"));
In Php i have:
header('Content-Type: application/json; charset=utf-8'); (don't know if this is important)

This is all..ty all for help

于 2013-01-05T19:30:13.457 回答