duan0403788996 2014-03-07 06:00
浏览 23
已采纳

PHP Google App Engine Charset UTF无法正常工作

I'm using google app engine for a php based web app. The content type is set in the html header as following.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Whenever I submit a html code sample from a form(Which is having a image upload field also), and that html code is converted into html entities like below,

htmlentities(stripslashes($_POST['code']), ENT_QUOTES, "UTF-8" );

There are some strange characters in the output like "=3D" for any "=" characters in the the code. I believe this is due to some error in the charset I'm working with.

This piece of code works fine in my localhost fine.

I tried following the solutions given in Defining CharSet for static HTML files , but the problem is my app.yml does not include only html files, it has other formats also. The app.yml looks like this.

- url: /(.*\.(ico$|jpg$|png$|gif$|htm$|html$|css$|js$|vtt$|swf$|woff$|ttf$))
  static_files: \1
  upload: (.*\.(ico$|jpg$|png$|gif$|htm$|html$|css$|js$|mp3$|flv$|vtt$|swf$|woff$|ttf$))
  application_readable: true

Is this actually due to some character encoding issue? How can I overcome this?

Thanks & Regards!

  • 写回答

1条回答 默认 最新

  • douxing5598 2014-03-07 07:34
    关注

    I think you're hitting this known issue. If it is, then you should star the issue if you can.

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

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?