Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-11-06
03:08 • Ticket [1823576fff] Fix fconfigure -xchar "\x00 \x00" status sti... artifact: d7781c7410 user: stwo
02:37 • Closed ticket [1823576fff]. artifact: 39fda3755a user: andreas_kupries
2007-11-02
13:33 • Add attachment tclUnixChan.c.patch to ticket [1823576fffffffff|1823576f... artifact: dccc3d480e user: stwo
13:33 • Ticket [1823576fff] Fix fconfigure -xchar "\x00 \x00" status sti... artifact: 51b49adc7a user: stwo
13:30 • Ticket [1823576fff]: 4 changes artifact: 284bff6acf user: stwo
00:39 • Ticket [1823576fff]: 4 changes artifact: f3691aae37 user: stwo
00:38 • Ticket [1823576fff]: 4 changes artifact: e71bd6e765 user: stwo
2007-11-01
20:48 • Ticket [1823576fff]: 1 change artifact: 2b08e9d263 user: dkf
2007-10-31
23:42 • Ticket [1823576fff]: 4 changes artifact: 33cd47045d user: stwo
16:42 • New ticket [1823576fff]. artifact: 5b46f0405c user: stwo

Fix [fconfigure -xchar "\x00 \x00"]

Closed / Accepted1823576fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-10-31 16:42:53
The values for the -xchar option are taken from the first byte of the passed utf8 strings and not encoding-converted.
If the value of one of the chars is \x00 the encoding will be set to the first byte of Tcl's utf8 sequence for 0 (c0 80), 0xC0.
This patch fixes the problem by adding the necessary conversions.

Patch generated from Tcl8.5b2.
stwoplain2007-10-31 23:42:54
File Added - 252213: tclUnixChan.c.patch
dkf Ticket [1823576fff]: 1 change [History diff]2007-11-01 20:48:11
stwoplain2007-11-02 00:38:41
File Deleted - 252213:
stwoplain2007-11-02 00:39:55
File Added - 252417: tclUnixChan.c.patch

Logged In: YES 
user_id=143350
Originator: YES

File Added: tclUnixChan.c.patch
stwoplain2007-11-02 13:30:08
File Deleted - 252417:
stwoplain2007-11-02 13:33:27
File Added - 252476: tclUnixChan.c.patch

Logged In: YES 
user_id=143350
Originator: YES

3rd version of the patch.
1st version: ok.
2nd version: better casts.
3rd version: removed unneeded parentheses.
File Added: tclUnixChan.c.patch
andreas_kupriesplain2007-11-06 02:37:57
Logged In: YES 
user_id=75003
Originator: NO

stuart I am accepting this patch. It is now in the HEAD. However, do you have a small test which I can add to the testsuite to demonstrate before/after behaviour ?
stwoplain2007-11-06 03:08:28
Logged In: YES 
user_id=143350
Originator: YES

I'm not sure how to add this to the testsuite, but this demonstrates:

Before:
% fconfigure stdout -xchar "\x00 \x00"
% scan [lindex [fconfigure stdout -xchar]] %c
192

After:
% fconfigure stdout -xchar "\x00 \x00"
% scan [lindex [fconfigure stdout -xchar]] %c
0
Log in (anonymous is fine) to add a comment.

Attachments: