3
我得到??????在MySQL中而不是印地語文本。我有以下代碼從edittext獲取印地文文本併發送到PHP頁面來存儲我的文本。如何將Android中的印地文文本存儲在MySQL中?
我的動態
public class MainActivity extends Activity {
EditText s;
Button b1;
private JSONObject jsonObject=null;
List<NameValuePair> nameValuePairs;
ProgressDialog dialog = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
s=(EditText)findViewById(R.id.editText1);
b1=(Button)findViewById(R.id.btn);
Typeface tf = Typeface.createFromAsset(getAssets(), "akshar.ttf");
s.setTypeface(tf);
b1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Toast.makeText(getApplicationContext(), ""+s.getText(), Toast.LENGTH_SHORT).show();
new GetAllPosts().execute();
}
});
}
private class GetAllPosts extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(Void... arg0) {
ServiceHandler sh = new ServiceHandler();
List<NameValuePair> params = new ArrayList<NameValuePair>(2);
params.add(new BasicNameValuePair("text",""+s.getText()));
jsonObject = sh.makeServiceCall("http://192.168.24.12/temp/v1/temp.php", ServiceHandler.POST, params);
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
}
}
}
你是如何檢查你有沒有?在MySQL? – greenapps
Endode字符串到UTF-8之前發送... –
雅...我檢查了...我越來越??????在mysql –