coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.46k stars 431 forks source link

Add Big5 series for Trad. Chinese encoding #327

Closed yorkxin closed 9 years ago

yorkxin commented 9 years ago

Hi there,

I'm from Taiwan, where we use Traditional Chinese. The CotEditor provides some non-Unicode encodings for Trad. Chinese, but the most common ones, Big5 series, is missing.

Here is what TextWrangler provides. Most common ones are available:

Although there are some missing variants, I think these are already useful. I'm not sure whether they're compatible to each other, so please add all of them if possible.

By the way, I've found that encodings list is hard-coded in constants.m. I just wonder that is it possible to load the list from OS X API instead of hard-coded list? CotEditor can only enable selected commonly-used encodings by default, and allow users to edit the list in preferences, just like TextWrangler.

Thanks!

Edit: Sorry, it's constants.m not constants.h.

Edit 2: To be clear, websites in Taiwan use UTF-8 today, while some text documents from legacy systems, Windows and governments are in Big5. Therefore Big5 is useful for us.

1024jp commented 9 years ago

Hi, thanks for your feedback. As a quick implementation, I've just added these three encodings to the list ;)

And your question: why they are hard coded. Actually I'm also not sure why it is currently so. It's probably just because the original developer of CotEditor would like to arrange the priority order of the encodings by himself. Since CotEditor was basically developed for Japanese users, it was fine and enough at that time. And he also wanted to keep the implementation simple so that the normal users who use Japanese don't need to customize their encoding list. However, now CotEditor is used also by non-Japanse speakers. Thus, it's better to improve the design around encoding list somehow. I'll consider about it.

yorkxin commented 9 years ago

Great! Thanks for your quick patch :smile:

And thanks for the comments about encoding list. I believe it's not that easy to reimplement this part. I'll look forward for it.

Thanks again! どうもありがとうございました!