Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 为静态HTML文件定义字符集_Google App Engine_Http Headers_Content Type_Static Files_App.yaml - Fatal编程技术网

Google app engine 为静态HTML文件定义字符集

Google app engine 为静态HTML文件定义字符集,google-app-engine,http-headers,content-type,static-files,app.yaml,Google App Engine,Http Headers,Content Type,Static Files,App.yaml,我只是尝试了好几次为Google App Engine提供的静态文件定义字符集,但都失败了 文件的标题部分不包含正确的meta equiv标记: <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 我试图添加到app.yaml文件行: - url: / static_files: root/create.html upload: root/create.html http_header

我只是尝试了好几次为Google App Engine提供的静态文件定义字符集,但都失败了

文件的标题部分不包含正确的meta equiv标记:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
我试图添加到app.yaml文件行:

- url: /
  static_files: root/create.html
  upload: root/create.html
  http_headers:
    Content-Type: text/html; charset=UTF-8
但是appcfg.py只是告诉我: URLMap类型的对象的意外属性“http\U头”。
在“9oxnet/app.yaml”第41行第5列中,要解决静态文件的此字符集标题问题,您需要在app.yaml文件中定义字符集:

 - url: /
   static_files: root/create.html
   upload: root/create.html
   mime_type: text/html; charset=UTF-8
现在,静态文件的内容类型头也正确地包含字符集信息

 Content-Type: text/html; charset=UTF-8
如果标题中不包含字符集信息,则某些浏览器不会尽快解析页面

 Content-Type: text/html; charset=UTF-8