foreach {r w} [chan pipe] break
fconfigure $w -translation binary -buffering none
fconfigure $r -translation binary -encoding utf-8 -blocking 0

proc gotdata ch {
    set data [read $ch 1000]
    puts stderr "NBread of size [string length $data]"
    if {![string length $data]} {
	puts stderr "That usually means an EOF."
	close $ch
	set ::forever 1
    }
}

puts -nonewline $w \xC3
fileevent $r readable [list gotdata $r]

vwait forever
