Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Inconsistent behavior with encoding convertfrom -failindex

Closed / Fixed33ab6d08ebdc0b422d26c59211168648138885faCreated 4 years agoUpdated 4 years ago
Descriptionplain2023-02-06 17:17:42
The -failindex option seems to behave differently depending on the nature of the invalid byte sequence.

```
%  encoding convertfrom -failindex idx utf-8 A\xC2
A
% set idx
1
%  encoding convertfrom -failindex idx utf-8 A\xC2B
AÂB
% set idx
-1
```

Both are invalid utf-8 byte sequences. In the first case, it detects the error, in the second case it does not.

/Ashok
Referenced by2
  • c9a3653986Fix [33ab6d08eb]: Inconsistent behavior with encoding convertfrom -failindex check-in2023-02-16 20:57:47
  • e13da3659aFix for [33ab6d08eb]: Inconsistent behavior with encoding convertfrom -failindex check-in2023-02-15 20:26:10
jan.nijtmanswiki2023-02-06 21:27:59

Looks like a little detail in the utf-8 decoder needs a fix

jan.nijtmanswiki2023-02-16 21:52:33

Fixed [here]

Log in (anonymous is fine) to add a comment.