看板PttCurrent
标 题Re: bbs client resize
发信站HKDAY (Wed Nov 9 21:32:30 2005)
转信站ptt!Group.NCTU!grouppost!Group.NCTU!hkday
※ 引述《[email protected] (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