VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   General (https://forums.vandyke.com/forumdisplay.php?f=11)
-   -   Unable input Chinese character on the telnet connection (https://forums.vandyke.com/showthread.php?t=12154)

seesea 11-10-2015 12:48 AM

Unable to input Chinese character on the telnet connection
 
2 Attachment(s)
Hi, I have a problem about input Chinese character, when using protocol "telnet" and encoding "GBK" to connect to servers which should support GBK, a server's connection can input Chinese character correctly, another one can't. I don't know why, any body can help me? Thand you. Here is a test below:

My system is windows XP SP3, SecureCRT's version is "Version 7.1.3 (build 378) - Official Release".
There is a server writen in php which encoding in ascii, I can type in the Chinese character correctly when I connect to the server using the system's telnet command, while using SecureCRT for connecting, the character become messy code. The screenshot below shows that my input in SecureCRT is "CRT客户端", but SecureCRT said that "You are a donkey!" :'( (a joke), it showed "CRT驴突搂露", and the server got the string "CRT驴突搂露"; Then I tested using the system's telnet command, everything is OK. Both clients' encoding is "ANSC/OEM - 简体中文 GBK". I tried different encodings and fonts, and different Chinese IME, but all didn't work.
Attachment 1215
https://forums.vandyke.com/attachmen...5&d=1447137969

The test using a php server which's code is below, and saved with encoding in ascii:
PHP Code:

<?php
// 确保在连接客户端时不会超时
set_time_limit(0);

$ip '127.0.0.1';
$port 3333;

/*
 +-------------------------------
 *    @socket通信整个过程
 +-------------------------------
 *    @socket_create
 *    @socket_bind
 *    @socket_listen
 *    @socket_accept
 *    @socket_read
 *    @socket_write
 *    @socket_close
 +--------------------------------
 */

/*----------------    以下操作都是手册上的    -------------------*/
if (($sock socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) == false) {
    die(
"socket_create() 失败的原因是:".socket_strerror(socket_last_error())."\n");
}

if ((
$ret socket_bind($sock,$ip,$port)) == FALSE) {
    die(
"socket_bind() 失败的原因是:".socket_strerror(socket_last_error())."\n");
}

if ((
$ret socket_listen($sock)) < 0) {
    die(
"socket_listen() 失败的原因是:".socket_strerror(socket_last_error())."\n");
}

$count 0;

do {
    if ((
$msgsock socket_accept($sock)) < 0) {
        echo 
"socket_accept() failed: reason: " socket_strerror($msgsock) . "\n";
        break;
    } else {
        
// 发到客户端
        
$msg ="连接成功!\n";
        
socket_write($msgsock$msgstrlen($msg));

        echo 
"新客户端连接成功。\n";
        
$buf socket_read($msgsock,8192,PHP_NORMAL_READ);


        
$talkback "收到的信息:$buf\n";
        echo 
$talkback;

        if (++
$count >= 5){
            break;
        }
    }
    
//echo $buf;
    
socket_close($msgsock);
} while (
true);

socket_close($sock);
?>

I find out it works fine when the php server's file saved in UTF-8 and the SecureCRT's encoding in UTF-8, but the real server is a third party's, I can't change it. So I have to use SecureCRT with encoding "GBK".

But on the other hand, SecureCRT's connection to another third party's server works fine when using the "GBK" encoding, the screenshort shows below:
Attachment 1216
https://forums.vandyke.com/attachmen...6&d=1447137969

Can you help me to point out how can I input Chinese character on the telnet connection to the php server encoding in ascii using SecureCRT with the encoding "GBK"?
Thank you!

rtb 11-10-2015 10:53 AM

Hi seesea,

Have you tried to use GB2312 or GB18030 for the character encoding?

seesea 11-10-2015 07:37 PM

Quote:

Originally Posted by rtb (Post 44818)
Hi seesea,

Have you tried to use GB2312 or GB18030 for the character encoding?

Thanks Todd, yes, I'v tried them and many others, these tow's result is the same as GBK.
:confused:

rtb 11-11-2015 11:48 AM

Hi seesea,

To determine what is happening, more investigation will need to be done than can occur in the forums.

Please send an email to support@vandyke.com with a subject of Attn: Todd - Character Encoding Problem.

seesea 11-11-2015 07:39 PM

Quote:

Originally Posted by rtb (Post 44835)
Hi seesea,

To determine what is happening, more investigation will need to be done than can occur in the forums.

Please send an email to support@vandyke.com with a subject of Attn: Todd - Character Encoding Problem.

Thanks Todd, I'v sent an email, please check the email if you have time, hoping the problem to be solved.

rtb 11-12-2015 09:56 AM

Thanks seesea.

I have received your email and responded. Once we find a solution via email, I will post to this thread.

seesea 11-13-2015 03:18 AM

Quote:

Originally Posted by rtb (Post 44847)
Thanks seesea.

I have received your email and responded. Once we find a solution via email, I will post to this thread.

Thank you very much Todd! Wishing to get your information soon :)

seesea 11-18-2015 07:41 PM

Occasionlly tested with SecureCRT version 5.5, it works fine! Because that is others', finally I use PuTTY for work instead.

seesea 11-20-2015 03:10 AM

1 Attachment(s)
Quote:

Originally Posted by rtb (Post 44835)
Hi seesea,

To determine what is happening, more investigation will need to be done than can occur in the forums.

Please send an email to support@vandyke.com with a subject of Attn: Todd - Character Encoding Problem.

I find out if I check the option "force character at a time mode", then I can input Chinese in the GBK encoding, and server can receive it correctly, but the SecureCRT can't display it.

https://forums.vandyke.com/attachmen...1&d=1448010433

rtb 11-20-2015 11:41 AM

Hi seesea,

Thanks for the information. We are still investigating this problem. We will work with you via email until we have a solution to post.

seesea 11-23-2015 07:37 PM

Quote:

Originally Posted by rtb (Post 44881)
Hi seesea,

Thanks for the information. We are still investigating this problem. We will work with you via email until we have a solution to post.

Thanks Todd, I will email you if more things found out.


All times are GMT -6. The time now is 03:02 PM.