KpyM Telnet/SSH Server - Forum
UTF8 mode and wide PDCurses Windows Console application |
darrin.wolf@infor.com |
UTF8 mode and wide PDCurses Windows Console application |
Oct 06 2015 16:02 |
|
I am trying to use UTF8 mode to display Japanese characters.
I am running a Windows Console application compiled using Visual Studio 2012 with Unicode. The characters that are written to the screen are all wchar_t (wide) characters. I must run the application after telnet into the server, via PUTTY client, using UTF8 remote character set. Also, (in PUTTY configuration) I am using MS Gothic font, with 'Japanese' font script.
There is an example menu screen that is supposed to appear like this:
---BEGIN PASTE---
WMS メインメニュー M2
0 入庫
1 入庫時 QC
2 棚入
3 補充と移動
4 ピッキング
5 出庫メニュー
6 在庫残高
7 在庫管理
8 タスクマネージャ
9 詳細...
番号入力
終了 = ESC
---END PASTE---
(That is how it is supposed to look.)
However, after configuring UTF8 mode in telnet.ini and changing code page in allusers.bat, chcp 65001, I still only see ? characters for every Japanese character like so:
---BEGIN PASTE---
WMS ??????? M2
0 ??
1 ??? QC
2 ??
3 ?????
4 ???????
5 ??????
6 ????
7 ????
8 ?????????
9 ??...
????
?? = ESC
---END PASTE---
Will KTS not be able to display Japanese characters when the Windows application locale has been changed to 65001 and the characters written by Curses are wide characters?
For example, in Ncurses and PDCurses, there are two APIs. One API is for single byte mode where every character is represented using a *char, and is a single byte. The other API uses *wchar_t to represent every character, which is represented by Unicode integers and is multibyte in UTF8 mode.
|
darrin.wolf@infor.com |
|
Oct 06 2015 17:28 |
|
I partially fixed the problem, I had left this line commented out with a ; character:
;export_code_page = 65001
Just removed the ; character and it *almost* works:
export_code_page = 65001
What is happening now is, several characters are left displayed on the screen after the Curses API clears and refreshes the screen(s) to display new screens. Also for some reason, some of the Japanese characters are displayed okay the first or second time, then when the screen that displays the (problem) characters is showed again later, it becomes a corrupt (or missing entirely) character. :-(
|
Kroum Grigorov |
|
Oct 09 2015 07:52 |
|
You can try to disable the scrollback buffer (set buff_height=0), it might help
l0c41://www.kpym.com/phpbb/viewtopic.php?t=460
l0c41://www.kpym.com/phpbb/viewtopic.php?t=338
Kroum
|
© 2007 - 2008 Kroum Grigorov