$ cat unicode.exp
spawn bash
send "aaébb"
expect -ex "aaébb" {send_user "PASS"}
$ expect -f unicode.exp
spawn bash
aaébbSegmentation fault
Environment (Ubuntu-10.04):
- expect-5.44.1.14
- tcl-8.4.19
- bash-4.1.5
- locale is set to "en_US.UTF-8"
More information:
$ strace expect -f unicode.exp
...
read(6, "aa\303\251bb", 4096) = 6
brk(0x9f76000) = 0x9f76000
write(1, "aa\303\251bb", 6aaébb) = 6
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
With `é' changed to `e', everything's all right:
$ cat unicode2.exp
spawn bash
send "aaebb"
expect -ex "aaebb" {send_user "PASS"}
$ strace expect -f unicode2.exp
...
write(1, "aaebb", 5aaebb) = 5
write(1, "PASS", 4PASS) = 4
...
Is this a bug in Expect, or bash, or am I doing something wrong?
Freddy Vulto
http://fvue.nl
This was just identified and fixed on the Expect cvs head:
https://sourceforge.net/tracker/index.php?func=detail&aid=3095935&group_id=13179&atid=313179
Jeff