Forum Discussion
iRules containing double-byte characters
when using the Configuration utility to create an iRule containing Chinese characters in a custom HTTP response, an error message that appears similar to the following example is displayed by the Configuration utility and logged to the /var/log/ltm file:
Dec 17 17:50:56 local/ltmtest err mcpd[5757]: 01070151:3: Rule [dss] error: line 1: [braces are required around the expression] [when HTTP_REQUEST { sets the timer to return client to host URL set stime 10 Use the Host header value for the responses if it's set. If not, use the VIP address. if {[string length [HTTP::host]]}{ set host [HTTP::host] } else { set host [IP::local_addr] } Check if the URI is /maintenance switch [HTTP::uri] { "/maintenance" { Send an HTTP 200 response with a Javascript meta-refresh pointing to the host using a refresh time HTTP::respond 200 content \ " "缂佸瓨濮\
Sorry! This site is down for maintenance.
" "Content-Type" "text/html" return } } If the pool_testLB is down, redirect to the maintenance page if { [active_members web-pool] < 1 } { HTTP::redirect "http://$host/maintenance"
- nitassEmployeeis it sol11661?
- George_Watkins_Historic F5 AccountOne workaround may be to base64 encode the response text, then decode before sending the response. That will allow the iRule to load. You'll probably also want to include a "charset" parameter (probably "big5") with your "Content-Type" header. Hope that helps,
- nitassEmployeeGeorge, nice tip! thanks.
[root@ve1023:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { HTTP::respond 200 content [b64decode "JiMzNjA3OyYjMzYwNDsmIzM2MjY7JiMzNjI5OyYjMzYxMDs="] "Content-Type" "text/html; charset=UTF-8" } }
- nitassEmployee
sorry it is duplicated (again).
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