drqvsx1228 2014-12-06 21:33 采纳率: 0%
浏览 30

htmlspecialchars():参数CodeIgniter中的多字节序列无效

i have a problem with a codeigniter's functions. This is my controller code: http://pastebin.com/YGj9ExkU

On my local machine it works perfect, but on my remote server it returns to me warning:

Severity: Warning Message: htmlspecialchars(): Invalid multibyte sequence in argument Filename: core/Common.php Line Number: 553

The PHP versions is same - 5.3

I think that problem inside my _clean function, but i don't sure about. My searching results don't have success. Some people said that problem with encoding.

  • 写回答

1条回答 默认 最新

  • doujiurong7210 2014-12-06 21:52
    关注

    Make sure you specify the encoding to UTF-8, e.g.

    htmlspecialchars($str, ENT_COMPAT, 'UTF-8');
    

    The default for htmlspecialchars() is ISO-8859-1, which might explain why you get that error.

    评论

报告相同问题?

悬赏问题

  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化