dongyu5104 2014-03-24 05:14
浏览 12

从android应用程序的php json数据中删除隐藏的标签

I have created json format data using php and it's showing like

"address":"8th Floor, \u200bTower  EN27  Sector 9  Salt Lake City  \u2013 700081  India",

I have used header('Content-Type: application/json; charset=utf-8'); and trying to remove using str_replace and preg_replace as well but unable to remove \u200b characters.

If I echo my address value it's showing fine

8th Floor, ​Tower EN27 Sector 9 Salt Lake City – 700081 India

One of my friend fetching my json data in his android application.

Please suggest me how to fix this issue.thanks

  • 写回答

1条回答 默认 最新

  • douji1853 2014-03-24 06:14
    关注

    I really don't know how to avoid those unicodes in the Result Json (PHP). But, I would like to suggest you to let android handle this.

    txtResult = (TextView) findViewById(R.id.txtResult);
    txtResult.setText(Html.fromHtml("8th Floor, \u200bTower  EN27  Sector 9  Salt Lake City  \u2013 700081  India"));
    

    The Unicode can be removed by setting to the textview with the help of HTML class.

    Here is the sample textview

    I have tested this also. It is working really fine.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行