Forum Discussion

mhuss3y_61750's avatar
mhuss3y_61750
Icon for Nimbostratus rankNimbostratus
Feb 21, 2014

UTF-8 encoding supported

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 https://devcentral.f5.com/wiki/iRules.tcp__payload.ashx 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.