看板 PttCurrent 關於我們 聯絡資訊
※ 引述《Alica.bbs@ptt.cc (Torsades de Pointes)》之銘言: : ※ 引述《piaip (我在測試)》之銘言: : : Telnet IAC handshake? : : 目前的 state machine 應該還算 robust, 暫時不用改 : : (或說,就算改了,目前 BBS 的架構多半也不會得利多少) : 我覺得可以引入RFC2066啦,這樣就不用在登入時在帳號後加.,來切換編碼了. : 只是這好像一點都不實用,因為我不知道有什麼client是支援RFC2066的... orz 不, 這個是極之實用的, 從前就有圖書館和物流中心提案, 要一些 terminal base 的服務供應商提供合乎可以自動辨別語系 的 server client系統. 以下是 PuTTY 有關 charset 的說明. 4.6.8 Disabling remote character set configuration PuTTY has the ability to change its character set configuration in response to commands from the server. Some programs send these commands unexpectedly or inconveniently. In particular, (an IRC client) seems to have a habit of reconfiguring the character set to something other than the user intended. 這裏只說明由 server side 發出的某些 command , 會影響 charset 設定. 倒是, 這不等於說支援 RFC2066 , 按照 terminal.c 來看, 應是 ISO 2022 那種. 而 telnet.c 定義見過的 IAC 42 , 似乎沒有下文. ( 事實上, 我也只找到 GB , JIS , ASC, UCS relate 的部份, 像是 ... /* GZD4: G0 designate 94-set */ case ANSI('A', '('): compatibility(VT100); if (!term->cfg.no_remote_charset) term->cset_attr[0] = CSET_GBCHR; break; 如果要做到 support Big 5, 至少要有這幾個 case : case ANSI('G', ')'): //CNS 11643-1992-Plane 1 case ANSI('H', '*'): //CNS 11643-1992-Plane 2 ) 問題回到目前的 charset , 如果我們要透過 RFC 2066 分辨 CJK 字種, 那起碼要有足以分辨龐大的字集體系的標準, 單靠 rfc 2066 本身的定義 , 不同人寫不同的 server / client 時便會大混亂... 參考 rfc 1922, iso2022 http://www.iana.org/assignments/character-sets 相反, 寫得好的話, 透過用戶選項, 可以讓系統自動跳換字集, 那兩岸編碼 不同的 ascii art 則有可能放在一起看了. -- ※ 發信站: 香港地(hkday.net) ◆ From: 61.93.63.111