解決UTF-8/BIG-5中文顯示問題

以下內容是為Blogger.com/Blogspot.com的用家而寫的。

近日讀收買佬兄的One Great Pawn Shop,發現了他在副題上說:”Keep shifting the fonts to and from Unicode(UTF-8) and Big5 if you encounter any difficulties.”

記憶中不少Blogger的中文Blog都有這個問題。現嘗試提供解決方法供大家參考,希望有用。

問題出自:在Setting > Formatting > Encoding一項選了Universal (Unicode UTF-8)來作網頁的語言編碼。

如果大家都是寫文言白話的話,改用Chinese Traditional (Big5)即可,但缺點是很多外字、廣東字(如「咁」、「喂」)便不能顯示,所有Big5編碼中不包括的外字便會變成問號。

選用UTF-8編碼理論上便可顯示所有外字,甚至包括簡體字和日文,但在Blogger,便會出現收買佬兄所遇到的問題。

解決方法:

在Template內的html作出一個小修改:

一)在頭幾行中找出<title><$BlogPageTitle$></title>這一句

二)把這句剪下,並貼在<head>和</head>之間內文字的最後一句,即</head>的前一行:

<head>
<$BlogMetaData$>
<style type=”text/css”>
….
….
….
….
<title><$BlogPageTitle$></title>
</head>

三)最後將修改儲存

這樣的話,當IE讀你網頁的html時,會先讀到BlogMetaData,知道文件是以UTF編碼,之後再讀到Title時,便會懂的讀用UTF來decode,網頁便不會出現亂碼或不能顯示。

zonble’s promptbook有更詳細的解釋

About Duke aka 公園仔

Testing
This entry was posted in 技術增值. Bookmark the permalink.

35 Responses to 解決UTF-8/BIG-5中文顯示問題

  1. Anonymous says:

    多謝鴨巴甸兄報料!!

    — 收買佬

  2. Anonymous says:

    Hey, by the way,睇晒你的大作,好喜歡”還靜於民”那篇。:)

    己加了你在連結,希望你不介意。:)

    — 收買佬

  3. 不用客氣,收買佬兄你的文章可讀性高,亦受歡迎,被此小問題困擾實在不值,對我這個讀者也有好處。

    謝謝你讀我的遊戲文章。我如很多人一樣,實在不能支持保皇一派,但民主人士過份經常不要臉的把七一的民意資產在未經審核(unaudited)的情況下悉數收為已用,我好想「燒佢數簿」。還望接近和支持他們的人,好心叫他們適可而止,否則賠上的不是中央的關係,而是大眾的支持。

  4. 有你的連結,相信我這裡的業務定可沾光不少。

    我也要把你的大押連結,相信你也不會介意囉。

  5. Anonymous says:

    Duke兄客氣啦,小弟的都係遊戲文章,白字錯字一籮籮,難登大雅之堂
    啦。

    我同你及Blog ring的朋友一樣,對左仔及民主派十分之反感,偏偏好
    多”熱血”分子,0甘於被兩派利用,睇到都唔開胃,學你話齋,真係想
    燒佢地數簿。:)

    — 收買佬

  6. sidekick says:

    UTF-8, 是好東西來的.
    兩岸三地的blog交流都靠它的了~ :)
    詳情, 請到http://sidekick.blogdns.org/archives/2004/07/05/91/
    看一看.
    blogger 少了trackback function. 這在Blog 而言, 是頗重要的.
    UTF-8是繁簡Blog 的橋樑呀! :)
    sidekick 字

  7. Alex says:

    多謝你的幫忙,我終於可以在任何地方,於不需再重新選碼的情況下,觀看自已所寫的東西了!

    日後多多交流!

    Alex

  8. Nana says:

    thanks! 我已照方法照辦.

  9. 一方 says:

    我依據此方法, 不過試過幾次都不成功, 出現亂碼一堆, 惟有用回BIG5碼. 有什麼方法?

  10. 馮.濤 says:

    我也有相同的問題,無法選取UTF-8,一直出現亂碼。請前輩們指導。

  11. Sheta says:

    Thanks for your hints, and for your visiting.

  12. K I L I K says:

    Thanks for the solution! Thanks for visiting~

  13. 真係多謝晒,本來我唔發覺有問題(因為我用 Firefox),但用 IE 6 睇,好多時 detect 做 Big-5 ,所以在 title 加句 Unicode-UTF-8。小弟可否 link 你個 blog ? :P

  14. manfred says:

    公爵,真係唔該哂!

  15. 螞蟻 says:

    感激不盡!

  16. willsin says:

    謝謝你. 你的方法十分有效! It has solved the problem that has haunted me for a long time.

  17. kyushu says:

    One thing to add:
    Using firefox can eliminate this problem, even though you do not change the blog template codes.
    IE may show nothing for blog in unicode UTF-8, leaving a blank page for readers.

  18. 小茶 says:

    謝謝你的幫忙,終於回復正常啦。^____^

  19. len says:

    Million thanks!! Now I know why no one read my blog lar! I used Firefox myself so I didn’t notice this problem, but I checked with IE and indeed I could not see the post. Now it is much better lar! Please read my blog lar!

  20. Wenli says:

    你好,我也是苦於相同問題,但我用了您的方法後網頁結構卻垮了,是否能幫我看看哪裡出了問題?不好意思。

    http://sdkfz251.blogspot.com

  21. Wenli says:

    啊,不好意思,那是我的語法有問題,昨天下午已經修正了,忘記通知你真是不好意思,也麻煩你多跑了一趟!你的方法真的有效,現在也不會再受到別人的抱怨了!謝謝!

  22. says:

    謝謝你!我一直沒有留意這問題呢!現在按你的方法改了 ~~ :-)

  23. 晨(月亮背面) says:

    謝謝!
    但不知怎的不成. (為什麼大家都成功了就我不行呢…淚如雨下中……)

  24. 郁雲 says:

    您好, 希望能連結您這篇文章 (其實是先斬後奏 :P )

  25. chanchan says:

    我剛轉用WP,用wp內import功能想把blogger的文章轉移過來,就遇到了亂碼。原來我的blogger一直用big-5,但試了你以上的方法也不能轉成UTF-8,試指教。

    現在我的BLOGGER和新網頁(www.chanchancafe.com)都是亂碼,有沒有辦法解救?

    (我是新手,好多wp或blog的語言都不懂)

    • chanchan,我那篇文章的內容幫不了你,問題是你以往一直用big5而不是unicode,所以import便出問題,據我所知,hkbloggers.com的blacksnow和無塵工作室室主兩位都遇過這問題,他們都好像解決了,你可以問問他。

  26. Kusou says:

    谢谢,改好了,刚在IE上也顯示所有外字,再一次谢谢!!

  27. 貴公子 says:

    to Dukedom of aberdeen,
    我的部落你看不到??等我改改看!

  28. Breezephyr says:

    很聰明的辦法,謝謝^^

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word