需要保存保存在达泰印地文 [英] Need to save Save DataI in hindi

查看:142
本文介绍了需要保存保存在达泰印地文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对调查程序创建Web服务。

在应用程序,用户可以选择作为调查印地文或英文。

每一件事情完美的英文调查。

在英国的调查,我得到下面于Android JSON到PHP。

<$p$p><$c$c>{\"survey_user\":\"20141112_115344\",\"caste\":\"\",\"contact\":\"\",\"datastreams\":[{\"answer\":\"Yes\",\"questionID\":\"61\"},{\"answer\":\"Computer\",\"questionID\":\"62\"}],\"polling_booth_no\":\"126\",\"Image_file\":\"IMG_121415773426063-1492383430.jpg\",\"userID\":\"12\",\"address\":\"\",\"email\":\"\",\"age\":\"\",\"name\":\"\",\"gender\":\"\",\"longitude\":75.8138678,\"language\":\"\",\"latitude\":30.8962427,\"Audio_file\":\"12_Audio1415773383664-1588847750.3gp\",\"survey_num\":\"32\"}

但是当我在印地文json的问题就来了。

<$p$p><$c$c>{\"survey_user\":\"20141112_115344\",\"caste\":\"\",\"contact\":\"\",\"datastreams\":[{\"answer\":\"????\",\"questionID\":\"61\"},{\"answer\":\"????\",\"questionID\":\"62\"}],\"polling_booth_no\":\"126\",\"Image_file\":\"IMG_121415773426063-1492383430.jpg\",\"userID\":\"12\",\"address\":\"\",\"email\":\"\",\"age\":\"\",\"name\":\"\",\"gender\":\"\",\"longitude\":75.8138678,\"language\":\"\",\"latitude\":30.8962427,\"Audio_file\":\"12_Audio1415773383664-1588847750.3gp\",\"survey_num\":\"32\"}

我真的不知道在哪里Android或PHP是问题。

静态印地文值保存在数据库中,使用后<​​code> mysql_set_charset('UTF8',$链接); 我查了一下,但动态JSON总是给人????? 值。 Plesae告诉我,我该怎么解决。


解决方案

@Amit库马尔,您应该使用

 数据库表字段集`utf8_general_ci`

保存您的印地文的数据,也可以使用

 `标题(内容类型:text / html的;字符集= UTF-8);`

在你的PHP文件,在那里你找回印地文数据上。

I am Create web service for survey app.

In app user can select survey as Hindi or English.

Every thing perfect in English survey.

In English survey I get below json from android to PHP.

{"survey_user":"20141112_115344","caste":"","contact":"","datastreams":[{"answer":"Yes","questionID":"61"},{"answer":"Computer","questionID":"62"}],"polling_booth_no":"126","Image_file":"IMG_121415773426063-1492383430.jpg","userID":"12","address":"","email":"","age":"","name":"","gender":"","longitude":75.8138678,"language":"","latitude":30.8962427,"Audio_file":"12_Audio1415773383664-1588847750.3gp","survey_num":"32"}

but problem comes when I get json in hindi.

{"survey_user":"20141112_115344","caste":"","contact":"","datastreams":[{"answer":"????","questionID":"61"},{"answer":"????","questionID":"62"}],"polling_booth_no":"126","Image_file":"IMG_121415773426063-1492383430.jpg","userID":"12","address":"","email":"","age":"","name":"","gender":"","longitude":75.8138678,"language":"","latitude":30.8962427,"Audio_file":"12_Audio1415773383664-1588847750.3gp","survey_num":"32"}

I really dont know where is problem in android or php.

Statically Hindi value is saved in database, after use mysql_set_charset('utf8',$link);I checked it but dynamically json always give "?????" value. Plesae tell me how I can Resolve.

解决方案

@Amit kumar, You should use

    collection " `utf8_general_ci` " in database table field 

to save your HINDI data and also use

   `header("Content-type: text/html; charset=UTF-8");` 

at the top of your php file where you retrieve hindi data..

这篇关于需要保存保存在达泰印地文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆