Ticket Hash: | 70c08b5b5dda63f69765741de5cb32b6ebb59c3a | |||
Title: | Unicode characters break RESP encoding | |||
Status: | Fixed | Type: | Code_Defect | |
Severity: | Important | Priority: | Immediate | |
Subsystem: | Resolution: | Fixed | ||
Last Modified: | 2024-05-22 11:51:48 | |||
Version Found In: | 0.4.0 | |||
User Comments: | ||||
anonymous added on 2023-12-29 08:10:31:
Script to reproduce:
Running this gives a crash:
When trying to track down this problem, sometimes I was seeing an error of the form:
This led me to https://stackoverflow.com/questions/72789950/error-with-redis-protocol-resp-during-bulk-load-when-data-contains-utf-8-chara which reports a similar problem though not involving Tcl. I'm not sure what the best fix would be for this. For now I have worked around it in my application by making sure I don't try to store characters outside the 8-bit range. I think it does need a fix in Retcl though. gahr added on 2024-04-22 12:37:54: As discussed in the Tcl Chatroom, I think it's best if any conversion is done client side. gahr added on 2024-04-22 12:40:23: I've added a test in f90952f00b anonymous (claiming to be Colin) added on 2024-04-23 06:49:43: Perhaps a note should be added to the documentation to specify that input strings must consist only of characters in the 8-bit range, i.e. byte strings. gahr added on 2024-05-22 11:51:48: I've added a section to the README, see https://code.ptrcrt.ch/retcl/doc/trunk/docs/index.html#_encoding. |