Forum Discussion
beefy80
Nimbostratus
Nov 11, 2019EBCDIC to ASCII conversion
Hello! I am trying to convert a string from EBCDIC to ASCII however I have found out the hard way that the encoding function is not available in TCL / iRules on F5. I have been researching how...
Leonardo_Souza
Cirrocumulus
Nov 11, 2019The enconding command exists in the tcl version used in F5 but is not available via iRules as you pointed out.
[root@LABBIGIP1:Active:Changes Pending] images # tclsh
% encoding convertto ebcdic "EXAMPLE"
ÅçÁÔ×ÓÅWhen I try via iRules:
when HTTP_REQUEST {
log local0. [encoding convertto ebcdic "EXAMPLE"]
}
Nov 11 17:51:20 LABBIGIP1 err tmm2[22248]: 01220001:3: TCL error: /Common/test1 <HTTP_REQUEST> - invalid command name "encoding" while executing "encoding convertto ebcdic "EXAMPLE""One possible solution is to try to build the conversion yourself, using string map:
when HTTP_REQUEST {
log local0. [string map [list "Å" "b"] "Åbc"]
}
Nov 11 18:19:04 LABBIGIP1 info tmm5[22248]: Rule /Common/test1 <HTTP_REQUEST>: bbcIf you can't do the mapping this way, you will have to look mapping using hex or binary.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects