dongyun8138 2015-01-21 06:06
浏览 238
已采纳

php导入excel撇号符号问题

I've got an excel importer for my website, which seems to be working fine - up until I found a row which has apostrophes, and it's trying to save the information into the database using �.

Example:

Branches in Vava’u, Haapai, ‘Eua and Niuatoputapu

Changes to:

Branches in Vava�u, Haapai, �Eua and Niuatoputapu

Is there any way I can fix this easily within php?

  • 写回答

1条回答 默认 最新

  • douxie1692 2015-01-21 09:22
    关注

    Try to replace the � by ' before saving in database. Sometimes MS Excel uses other chars with different codes for special chars (non printable ASCII codes).
    Vava’u - contains 0x19 char code, use 0x27 instead
    ‘Eua - contains 0x18 char code, use 0x27 instead

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效