Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2015, 11:48 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Question Unable to input Chinese character on the telnet connection

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.
telnet.jpg


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:
telnet2.jpg


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!

Last edited by seesea; 11-10-2015 at 02:27 AM. Reason: edit php code
Reply With Quote
  #2  
Old 11-10-2015, 09:53 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi seesea,

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

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 11-10-2015, 06:37 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Quote:
Originally Posted by rtb View Post
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.
Reply With Quote
  #4  
Old 11-11-2015, 10:48 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
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.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 11-11-2015, 06:39 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Quote:
Originally Posted by rtb View Post
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.
Reply With Quote
  #6  
Old 11-12-2015, 08:56 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Thanks seesea.

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

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 11-13-2015, 02:18 AM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Quote:
Originally Posted by rtb View Post
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

Last edited by seesea; 11-18-2015 at 06:35 PM.
Reply With Quote
  #8  
Old 11-18-2015, 06:41 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Occasionlly tested with SecureCRT version 5.5, it works fine! Because that is others', finally I use PuTTY for work instead.

Last edited by seesea; 11-18-2015 at 10:40 PM.
Reply With Quote
  #9  
Old 11-20-2015, 02:10 AM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Quote:
Originally Posted by rtb View Post
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.

Attached Images
File Type: jpg force.jpg (55.3 KB, 3935 views)
Reply With Quote
  #10  
Old 11-20-2015, 10:41 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
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.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #11  
Old 11-23-2015, 06:37 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Quote:
Originally Posted by rtb View Post
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.
Reply With Quote
Reply

Tags
chinese , gbk , telnet

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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