Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-07-15
02:16 • Closed ticket [949905ffff]: Unicode null characters on UTF-8 channels plus 2... artifact: bb9ff69f48 user: hobbs
2004-07-03
00:18 • Ticket [949905ffff]: 5 changes artifact: 55d1b7e8cf user: hobbs
2004-05-27
21:36 • Ticket [949905ffff]: 5 changes artifact: ecf8cfa296 user: rmax
2004-05-08
02:52 • Ticket [949905ffff]: 4 changes artifact: 85e88c5a61 user: rmax
02:49 • Add attachment utf-8-nullbyte.patch to ticket [949905ffffffffff|949905f... artifact: a359ccf8e3 user: rmax
02:49 • Ticket [949905ffff] Unicode null characters on UTF-8 channels status still O... artifact: 6ce2bf00ed user: rmax
01:19 • Add attachment utf-8-nullbyte.patch to ticket [949905ffffffffff|949905f... artifact: a4cad008f6 user: rmax
01:19 • Ticket [949905ffff] Unicode null characters on UTF-8 channels status still O... artifact: 9135563453 user: rmax
2004-05-07
22:58 • Ticket [949905ffff]: 4 changes artifact: 7107dbbb50 user: rmax
22:57 • Ticket [949905ffff]: 4 changes artifact: 289a236e76 user: rmax
22:57 • Add attachment utf-8-nullbyte.patch to ticket [949905ffffffffff|949905f... artifact: 694941daeb user: rmax
21:22 • Ticket [949905ffff] Unicode null characters on UTF-8 channels status still O... artifact: ef5d10b7d4 user: rmax
14:21 • New ticket [949905ffff]. artifact: 37abf561da user: rmax

Unicode null characters on UTF-8 channels

Closed / Fixed949905ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2004-05-07 14:21:27
A Unicode null character (\u0000) comes out as \xc0\x80
instead of \x00 when it is being printed to a utf-8
encoded channel.

The attached patch for HEAD fixes this and doesn't
break any tests here. If the patch gets accepted I'll
create one for the 8.4 line as well.
rmaxplain2004-05-07 21:22:04
File Added - 86410: utf-8-nullbyte.patch
rmaxplain2004-05-07 22:57:48
File Added - 86421: utf-8-nullbyte.patch

Logged In: YES 
user_id=124643

While doing further tests, I found, that null bytes that are
read from a utf-8 encoded channel also don't get translated
to \xc0\x80. The updated patch fixes that as well.
rmaxplain2004-05-07 22:58:37
File Deleted - 86410:
rmaxplain2004-05-08 01:19:13
File Added - 86438: utf-8-nullbyte.patch

Logged In: YES 
user_id=124643

Another version of the patch - this time with tests and
comments.
I'll commit this one to HEAD to get wider testing.
rmaxplain2004-05-08 02:49:17
File Added - 86449: utf-8-nullbyte.patch

Logged In: YES 
user_id=124643

The logic was not quite right before, so here is another
(hopefully the last) attempt.

The only thing I am not sure about is whether this patch
adds the risk of a buffer overflow by one byte when in input
mode there is only one spare byte left in the destination
buffer and the next character in the source buffer is a null
byte.
rmaxplain2004-05-08 02:52:29
Logged In: YES 
user_id=124643

Forget that comment about the buffer overflow. I had
overlooked, that the size of the dest buffer gets adjusted,
so that alyways room for at least one more UTF-8 character.
rmaxplain2004-05-27 21:36:05
Logged In: YES 
user_id=124643

Comitted a fix to HEAD, and core-8-4-branch.
hobbsplain2004-07-03 00:18:56
Logged In: YES 
user_id=72656

This is fixed, and left open as a watch item for the next
releases (8.4.7 and 8.5a2).
hobbs Closed ticket [949905ffff]. [History diff]2004-07-15 02:16:42
Log in (anonymous is fine) to add a comment.

Attachments: