Skip to content
Tcl Source Code View Ticket
Login

View Ticket

handling leftover prefix in table encoding

Closed / Fixedd7fd37ebd9e64d1a33a8a586dc439fe85a19085fCreated 4 years agoUpdated 4 years ago
Descriptionwiki2023-03-19 21:42:19
Example:
$ tclsh8.6
% string length [encoding convertfrom shiftjis \x82]
0

Most encodings in Tcl 8.6 just pass through left-over bytes as-is. This one is different. So, what should we do here? In the current Tcl 8.7 code, Ashok wrote:

	 * TODO - this is broken. For consistency with other
	 * decoders, an error should be raised only if strict.
	 * However, doing that check cause a whole bunch of test
	 * failures. Need to verify if those tests are in fact
	 * correct.
	 */

That's exactly what this ticket is about.

Referenced by3
jan.nijtmanswiki2023-03-19 21:54:19

Possible fix [here]. @Ashok, what do you think?

I only see a single test result changing, exactly as I would expect.

apnadkarniplain2023-03-20 02:14:44
Fix seems reasonable to me.

/Ashok
jan.nijtmanswiki2023-03-20 12:01:09

Fixed [here]. Thinking more, it's probably better to silently remove the prefix character for the "tcl8" profile, as is done in Tcl 8.6.

apnadkarniplain2023-03-20 13:27:33
Given there is no "correct" behavior for this profile, I agree tcl8 compatibility is preferable.
Log in (anonymous is fine) to add a comment.