2016-12-17 36 views
1

我有一個html頁,this addressGithub的頁面變化的內容字符集 - UTF8和windows1256阿拉伯語

上述html文件的charset爲​​,(如果你去view > text encoding > arabic(windows)就可以看到正確的頁面)

enter image description here

但默認情況下,GitHub的服務器發送utf-8字符集:

$ curl -I https://marsii.github.io/T3st/1.html 
HTTP/1.1 200 OK 
Server: GitHub.com 
Content-Type: text/html; charset=utf-8 
Last-Modified: Sat, 17 Dec 2016 03:55:24 GMT 

,我不能改變這個charset用HTML代碼,我測試此參數:

<meta http-equiv="content-type" content="text/html; charset=windows-1256"> 

,但我的網頁不正確的字符集(在view > textencoding)顯示爲utf-8,而不是更改爲阿拉伯語。

如何使用阿拉伯字符集顯示我的頁面正確?

回答

2

GitHub的頁面expects pages to have been stored in UTF-8

所以if you can encode your files in UTF-8,並把它們放回喲你GitHub庫,GitHub的頁面將正確地爲他們服務。

注意,有一些最新的GitHub頁面改變
markdown support, without Jekyyl; no more gh-pages branch,如果你想; relative links; theme switcher
所以這是可能的,一些錯誤不存在。

但是使用utf-8文件應該是一個足夠好的解決方法,並且將支持任何code point

+0

非常感謝,我在我的linux中使用他的命令並將html頁面ftom windows1256轉換爲utf8'iconv -f windows -1256 -t utf8 FILENAME -o FILENAME',謝謝 –