Description: |
(text/x-fossil-wiki)
The following script should print the first line read from the file but instead
it produces the error, "invalid or incomplete multibyte or wide character".
There is a utf-8 encoding in the second line, not the first:
<blockquote><code><verbatim>
set chan [file tempfile]
chan configure $chan -encoding binary
# \xc0 is invalid in utf-8
puts -nonewline $chan a\nb\xc0\nc\n
flush $chan
seek $chan 0
chan configure $chan -encoding utf-8 -buffering none -eofchar {} -translation lf -profile strict
puts [gets $chan]
</verbatim></code></blockquote>
|