Forum Discussion
hooleylist
May 18, 2010Cirrostratus
Hi Den,
Here is an old post on a related issue with nulls in binary data. The fix there was to use binary format:
http://devcentral.f5.com/Forums/tabid/1082223/asg/50/showtab/groupforums/aff/5/aft/1253/afv/topic/Default.aspx
Unruley
Please try this out and let us know:
HTTP::payload replace offset 0 [binary format ca* 0 "my goofy string"]
FYI, the problem is that the literal string is converted to Utf-8 when Tcl compiles the rule. This changes any embedded NUL's to C0 80 in the string. Therefore, you still need to use the binary format command to convert from the Utf-8 encoded literal string into a binary array (this is what keeps HTTP::payload replace offset 0 "\000my goofy string" from working).
There is also a known issue with the binary format command that will prevent just using a* from working correctly (ie, binary format a* "\000my goofy string") This has been fixed in the upcoming 9.0.3 release.
Aaron