Hi devcentral, i’d like to know how strings in iRules are interpreted - are they read as Unicode? and is there a way to encode/convert them in UTF-8?
thanks!
Hi devcentral, i’d like to know how strings in iRules are interpreted - are they read as Unicode? and is there a way to encode/convert them in UTF-8?
thanks!
I just did a quick search for you and there is a note (below) in this link DevCentral - An F5 Technical Community which should help you.
Note: Currently, iRules usually treats binary data in TCL variables as UTF-8 strings. Therefore, care must be taken when processing binary TCP payloads. In particular, do not assign the result of TCP::payload to a variable if non-text data should be processed literally. See the third example below for a way to do a binary search-and-replace in a TCP::payload. TCL variables explicitly created as binary data (e.g. via the binary format command) are not treated as UTF-8 strings. There is an outstanding enhancement request (tracked as CR47762 / BZ273220) to treat TCL variables as binary data (rather than UTF-8 strings) as appropriate.