Swedish characters and UTF-8

前端 未结 7 1998
有刺的猬
有刺的猬 2020-12-01 20:59

I use UTF-8 on all my pages, but some Swedish characters (å ä and ö) get messed up (just a square box with some letters in). My database is set to utf8_gener

7条回答
  •  独厮守ぢ
    2020-12-01 21:41

    Works fine for me either double-clicking a file (as long as the editor is utf-8 capable) or serving it from localhost (Apache, defaults to UTF-8).

    You should indeed check what HTTP headers your web server is sending along the file. If your previous content is in English (read: ASCII) you may have never had a hint that your server was overriding the infile declaration of UTF-8 with a header saying ISO-8859-1 or Windows-1252.

    You may take a look at the headers in realtime with some Firefox extensions like Live HTTP Headers or HTTPFox. If this is the cause of the mishap and your server is Apache just add the line AddDefaultCharset utf-8 either in the mainl httpd.conf file or a .htaccess file in the webroot folder.

提交回复
热议问题