Re: why expect make the Chinese code garbled
- From: Jason <luoyuhong@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 08:58:27 -0700 (PDT)
On Jul 31, 8:59 pm, cla...@xxxxxxxxx (Cameron Laird) wrote:
In article <1c88d931-09a3-4963-95d0-36f56db18...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Jason <luoyuh...@xxxxxxxxx> wrote:
Hi all,
I use expect scripts in gnome-terminal to login a bbs
=============================
#!/usr/bin/expect
set user [lindex $argv 0]
spawn ssh $user@asite
interact timeout 160 {send "jk"}
exit
============================
The bbs site is Chinese character, if I just use ssh command, Chinese
character is readable, but if I use expect scripts, it make Chinese
character garbled. I read the expect manual page, there is no anything
about charset. what can I do?
.
.
.
I it were mine, my next step would be to use autoexpect <URL:http://wiki.tcl.tk/autoexpect>, and see what I learn from that.
thanks! the reason is the environment variable, if I use
LC_ALL=zh_CN.GB18030 ./myscripts
it works.
I don't know how to set it in expect scripts, I use
set env(LC_ALL) zh_CN.GB18030
it didn't work.
.
- Follow-Ups:
- Re: why expect make the Chinese code garbled
- From: Don Porter
- Re: why expect make the Chinese code garbled
- References:
- why expect make the Chinese code garbled
- From: Jason
- Re: why expect make the Chinese code garbled
- From: Cameron Laird
- why expect make the Chinese code garbled
- Prev by Date: Re: WebKit
- Next by Date: Re: Webservice package over https with authorization
- Previous by thread: Re: why expect make the Chinese code garbled
- Next by thread: Re: why expect make the Chinese code garbled
- Index(es):
Relevant Pages
|