tcl9.0 finds wide character but doesn't report line number
Open52b83aa279de717a047f80c71945b4dc94b15912Created 3 years agoUpdated 3 years ago
Descriptionplain2023-11-23 22:15:56
I had a very long tcl file full of code snippets, inside
if { 0 } { ;#comment
...
}
which I use to test out new code. Somehow it got 2 chars corrupted into the byte 0xB0 and so it gave the error:
couldn't read file: <filename> invalid or incomplete multibyte or wide character
I guess this is new to tcl9.0 as prior versions, even 8.7, don't mind this in the file.
The problem is, however, that tcl doesn't provide the line number of where the problem is, and so it took a tedious binary chop/search to find the line that had got corrupted. And since there were 2 places, it was more difficult to find, luckily my editor was able to search for the mangled byte.
I think that is a bug and it should be fixed.
oehharwiki2023-11-24 09:07:51
Hi, thanks for testing, great !
The issue might also be, that the source was not encoded with utf-8. The encoding of source changed from the system encoding to utf-8.
The old behaviour may be used by "source -encoding ... file.tcl".
And a more verbose message where to find the issue would be great. For sure, this is possible.
Take care, Harald
Log in (anonymous is fine) to add a comment.