Big5 與 WHATWG Encoding Standard

到了 2017 年還是要講 Big5 編碼……這篇算是 But 的 Big5-UAO 從頭說起的續篇。

WHATWG Encoding Standard 是一個用 WHATWG 名義發表,試圖最後一次解決規範瀏覽器對 Web 的不同編碼的行為的規格書,還有提供標準的 DOM API。大約幾年前開始,規格書的編輯就和 MozTW 社群這邊討論,想要知道要如何產生一個統一的 Web 使用的 Big5 字碼表。

XKCD: 標準規範

討論滿攏長的,總之最後的結論是因為在 Web 上沒有看到顯著的使用 Big5-UAO 編碼的網站,所以 Web 應該使用基於 Big5-HKSCS 的字碼表。那個字碼表後來也就和 Encoding Standard 一起被發表出來且實作在 Firefox 43 中。

當初其實和 but 一樣有點錯愕(或是哀傷)的,不過想想台灣(或是台灣的原 Big5-UAO 使用者)比起香港能夠先拋棄 Big5,到一種 Web 上量不到有使用狀況的情況,其實是一種成就啊。Big5-UAO 在 PTT 等環境的使用對使用者來說也是近乎透明的(由 BBS Client 直接支援),也算對這個字碼表的地位的重要承認。

會突然想起這事,後來也發現是因為跟 HKSCS 有關:#whatwg 上面在問 Encoding Standard 表的重複對應問題,研究之後發現是因為 Big5-HKSCS 沒有處理,把變成重複編碼只對應到單一的 Unicode 字碼導致的。原本 Big5 的重複文字有兩個,會對應到 CJK Compatibility Ideographs 去。

我昨天也就順手更新了 MozTW 網站上那份 Mozilla 系列與 Big5 中文字碼文件(不知為何後來就變成我維護了)。希望這次是最後一次更新了。相關的討論都有在那份文件上連結,可供參考。

We are not there yet – Code Rush 雜感

感謝 MozTWIrvin 等人籌辦活動,今天終於有機會坐在電影院好好看完 Code Rush 這部電影。

這部電影是從 1998 年 3 月 31 日,Netscape 釋出 Mozilla 原始碼,建立 Mozilla 自由軟體專案的前幾週開始講起,一路講到最後 Netscape 決定賣給 AOL 的時刻。1998 年,Netscape 在微軟強大的競爭之下,決定以釋出原始碼,建立自由軟體專案的方式奮力一博來維繫自己的影響力,以及作為一家公司的營利命脈。這件事,就我們後來所知,是完全失敗的。Netscape 逃不了售出的命運(雖然換股的價碼很不錯),員工在併購之後各奔東西,微軟成功壟斷瀏覽器市場;作為故事背景的 Mozilla 自由軟體專案,直到 2004 年才以 Firefox 這個產品重新樹立影響力,如鳳凰般從灰燼中重生(Firefox 最早的產品名是 Phoenix)。

在電影院沉浸的感受是強烈的。就我去了幾次的粗淺感受,矽谷的確和 1998 年一樣,是個掏金的地方。辦公室有堆滿點心的廚房、懶骨頭沙發、熔岩燈——程式設計師可以帶著一技之長去大公司(「establishment」)享受看似成功的人生,或是到新創公司充滿夢想,拿股票選擇權,即片中 Jamie Zawinski 所稱的樂透彩票。Milestone 前的風雨欲來,朝向「Zarro Boogs」前進的感覺也是一模一樣的(連 face-palm 也一樣)。片中的 Michael Toy、Jamie Zawinski、Tara Hernandez 等人趕上了 1998 年 3 月 31 日 Milestone,然後再隨著 Netscape 的瓦解往人生下一階段前進。

我喜歡片中 Zawinski 對 Mozilla 自由軟體專案的精準描述。很欣慰的,雖然沒有成功拯救 Netscape,Mozilla 後來的確也重生了,發揮了使命與影響力(順便賞了我一個工作)。但 1998 年與 2012 年的差異真的不大。Mozilla 基金會與公司作為 Mozilla 軟體專案的主要貢獻者,必須在主導專案,維繫 Mozilla 使命的同時保持自己的影響力與金流。Mozilla 抵抗的依然是奉行封閉、獨佔的公司與其軟體生態圈。Zawinski 對網路也有精準的預測:「我們處在一個產業的起點。誰知道這個產業會怎樣發展,搞不好又會變成像電視一樣,被少數公司所掌控,決定我們能看到、聽到什麼,這有太多先例了。」

感謝 OrinX 的聯絡,今天的活動最後有一段 Tara 向參與同好的打招呼影片;她後來加入了 Pixar 動畫,在影片中也和我們展示了他們現在用的一模一樣的工具:Tinderbox、Bugzilla …。她說我們好像真的成功了,「網路已經無所不在 … 想必台灣和美國一樣,走在路上看到的廣告上面一定都有個網址」。但其實我們還沒有成功:現在在路上的廣告出現的並不是網址,而是「請上 Yahoo! 奇摩搜尋『…』」或是「請上 Facebook 『…』粉絲團」,人們偏好的是封閉平台的「體驗」與「安全」,而不是開放與自由。

最後我聽到 Irvin 在活動會場宣傳 Mozilla TaiwanFacebook 粉絲團以及線上 Code Rush 電影院活動,心中覺得相當的諷刺。沒有不敬的意思,這是當下能做把事情做好的方法。但有一天,我希望我們能不用在「對」與「好」之間選擇。

有一天。


如果有興趣的話,可以 clone mozilla-central repository,然後輸入 git log --topo-order --reverse | head,你會得到這個:

commit 781c48087175615674b38b31fcc0aae17f0651b6
Author: ltabb 
Date:   Sat Mar 28 02:44:41 1998 +0000

    Free the lizard

mozilla-central 即 Mozilla 所有程式,包含目前 Firefox 的程式碼的 repository。歷史呀。

Common misconceptions about Boot-to-Gecko, and the Web

中文版刊登於謀智台客部落格。

Being asked to introduce the Boot to Gecko project to various audiences, I think it’s appropriate for me to write some FAQ here on common misconception of the project, and the Web in general.

Misconception #1: Boot to Gecko is yet another mobile platform for apps.

To run you apps on Boot to Gecko (and any other devices with a browser), you would just have to deliver your apps on the plain old-school Web on Internet.

Boot to Gecko is aim to (re)boot to the web. That is, to bring the Open Web to a level that it could compete with proprietary mobile platforms. To application developers, the Web is yet another platform to develop (you would need to port your apps from Obj-C/Java to HTML5), but the good news is your app would now becomes the cross-platform web app, not B2G Apps, PhoneGap Apps, nor Metro-style Windows 8 Apps, and it’s always available to everyone on every platform, one web address away. It would also make your app free from platform vendor control, since no one owns the Web.

Misconception #2: Phone need to be always on-line to use Boot to Gecko and web apps.

Even though every apps on B2G phone is from a web address, even the home screen itself, offline capability can be easily achieved with HTML5 Offline AppCache technology. It’s something that can be done today, available to many browsers available on both desktop and mobile. The only thing you should take care of is how network dependent your app really is. Even on iOS, Twitter app or Facebook app is useless without network connection. You should define a clear boundary between program assets and online information in your HTML5 app. After all, it’s not just an website anymore.

Misconception #3: Web app is crappier than “native apps” in turns of UX.

This is a notion I strongly disagree. The only reason mobile browsers on devices perform worse than the native app is because the venders of the device did not invest enough effort on it. There is a conflict of interest here. Limiting the capability of APIs accessible, besides permission management issue, is the same thing. At Mozilla, we can show that with proper engineering, mobile browser, or web runtime, can run smoothly as silk on devices and deliver the so-called “native” experiences. Other venders investing the web is also doing the same thing. For devices running B2G or Chrome OS, the native app is web apps, there is no point to make it slow, intentionally or unintentionally.

Misconception #4: Web apps running on B2G is dependent on B2G or Mozilla Web APIs.

Yes and no. If you need specific access like SMS message database or phone dialing, initially B2G would be the only platform that make these features available to you. However, we design these Web APIs with standardization in mind, and work closely with standardizing bodies to made these APIs ready for other venders to implement. Evidently, our Web APIs does not live under PhoneGap.*, Windows.*, nor Ti.*; they are design to be at where it should be, like navigator.* (Sure, as experimental features, they came with moz prefix right now, and usual feature detection is advised).

If you choose other packaged web app solution, then, your web app is depend on it. Forever. Mozilla would like you to develop and distribute apps directly to the Web, and you should.

Misconception #5: Apps on Web are free of charge, developers will never make money out of it.

Yeah, like no one had ever become billionaire because of applications or services they put on the web.

There are tons of way to provide services on the web in exchange for money, surely there are ways to make money with web apps, other than bagging for US$0.99 from users. Sure, closed platform with single distribution “app store” seems effective in terms of delivering revenue to developers (besides having 30% of your money being taken along the away), but Mozilla believes choices matters, and an open platform deliver choices to both users and developers.

Mozilla is also exploring effective distribution and monetize channel for the Open Web, in our Open Web App Project and the Mozilla Marketplace website. The goal of offering choices and freedom is deeply embedded in the feature design, both in browser App API and in storefront, and with user authentication and authorization (which is the scope of the Mozilla Persona project, previously known as BrowserID).

Conclusion

Just like Mozilla did with Firefox years ago, we intend to deliver great product that could influence the market, and let the market influence other venders. No one owns the Web, and no one should. Mozilla is here not to make money or become monopoly, but to bring the goodness to the Web that could drive innovation and opportunities centuries to come.

The CTO of Opera Software, Håkon Wium Lie, once said the Web will last for at least 500 years, and made impact to the society just like Gutenberg’s printing press. I totally agree with him, even though none of us will be around and told me I was wrong, as he puts it. Let’s make it great.

Disclaimer: This post express the opinion of my own and does not necessarily represents the point of view of Mozilla nor Mozilla Corp.