Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Expect retourne des caractères spéciaux. Problème d'encodage?

11 views
Skip to first unread message

chris_...@yahoo.fr

unread,
Aug 9, 2010, 9:34:48 AM8/9/10
to
Bonjour,

J'ai un soucis avec Expect sous Windows 7 64 bits (je reproduit
également le même problème sous XP 32 bits)
Je m'explique:
Je doit me connecter en telnet sur un équipement distant.
Comme client telnet, j'utilise plink car il supporte également ssh si
besoin.
La connexion se passe bien, par contre, lorsque j'envoie une commande,
la réponse contient des caractères particuliers et me décale tout.

Au lieu d'avoir ceci:
SEND ===>environment no terminal-timeout inhibit-alarms
RCVD<--- environment no terminal-timeout inhibit-alarms
SEND ===>exit all
RCVD <--- exit all

J'obtiens ceci:

SEND ===>environment no terminal-timeout inhibit-alarms
RCVD<--- environment no terminal-timeout inhibit-a?larms
inhibit-alarms : disables the alarm reporting in the current
session
SEND ===>exit all
RCVD <--- environment no terminal-timeout inhibit-a?larms [7Dlarms
[7Dexit all
^
invalid token

Je pense à un problème d'encodage utilisé par Expect car i j'utilise
plonk directement à partir d'une fenêtre DOS, tout se passe bien.

Quelqu'un a déjà eu un problème similaire?

Cordialement

Christian

Kroc

unread,
Aug 10, 2010, 6:29:07 AM8/10/10
to
Ca répond quoi fconfgure sur ton canal ?

--
David Zolli

chris_...@yahoo.fr

unread,
Aug 10, 2010, 8:22:18 AM8/10/10
to

Bonjour David,


En faisant "fconfigure $spawn_id" ?
Comment je connais le nom du canal ouvert par Expect?

Christian

Kroc

unread,
Aug 11, 2010, 3:51:01 AM8/11/10
to
On 10 août, 14:22, chris_pro...@yahoo.fr wrote:
> Bonjour David,
>
> En faisant "fconfigure $spawn_id" ?
> Comment je connais le nom du canal ouvert par Expect?

la commande [file channels] va te donner la liste des canaux ouverts.
Après, je n'ai jamais utilisé expect, il a sans doute sa propre
commande de configuration.

--
David Zolli

chris_...@yahoo.fr

unread,
Aug 11, 2010, 6:43:37 AM8/11/10
to

Bonjour David,

Effectivement, l'identifiant du canal est contenu dans la varaible
globale de Expect nommée spawn_id.
fconfigure $spawn_id me retourne -blocking 0 -buffering none -
buffersize 4096 -encoding cp1252 -eofchar {{} {}} -translation {auto
lf} -mode 3

Je vais pouvoir modifier l'encodage du canal.

Merci de ton aide.

Cordialement,

Christian

0 new messages