Forum Discussion
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!
- IheartF5_45022Nacreous
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.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com