Tera Term 5 以前の内部バッファの文字コードはDBCS(Double byte Character Set)でした。 例えば「Language[言語]」を"Japanese"としたとき内部バッファの文字コードはShift_JISでした。
Tera Term 5 の内部バッファの文字コードは Unicodeです。
大まかなデータの流れは次のようになっています。
+--------------+
+------------------------+ Code:Unicode | |
| +--------------------->+ Window |
| buffer@buffer.c | | Display |
| Code:Unicode | Code:Unicode | Print |
| | BuffPutUnicode() | | +----------+
| +<------------------+ +--------------+ +-----------------------+ | |
+------------------------+ | | | |Log File |
+----------------------------+ VTParse()@vtterm.c +----->+ |
+------------------------+ CommRead1Byte() | Terminal | | |
| +----------------------------------------------->+ | +----------+
| Input buffer@ttpcmn | | |
+-----------+ | Code:Input | Code: +----+------------------+
| | | | Unicode to Input +--------------+ |
| Socket +---------------->+ +<---------------------+ | |
| Serial | CommReceive() +------------------------+ CommTextEchoW() | Talker | |
| Pipe | CommBinaryEcho() | Keyboard | | Code:Unicode(UTF-8)
| Plugin | +------------------------+ | SendMem | | DDEPut1()
| +<----------------+ | Code: | File | |
+-----------+ CommSend() | Output buffer@ttpcmn | Unicode to Output | Clipboard | |
| Code:Output +<---------------------+ macro +<---------+ |
| | CommTextOutW() | | | |
| | CommBinaryOut() +--------------+ | |
+------------------------+ CommRawOut() | |
| |
| |
| |
| v
+-------------------+ DDE, UTF-8/binary +-+----+-----------+
| +------------------------------------->+ |
| ttpmacro.exe | | ttdde.c |
| | | |
| | DDE, UTF-8 | |
| +<-------------------------------------+ |
+-------------------+ +------------------+
Windows 95/98/Meのとき、キー入力は Unicode に変換してから処理を行います。 描画は UnicodeをMBCSに変換して描画します。