Forum Discussion

zhang_san_10139's avatar
zhang_san_10139
Icon for Nimbostratus rankNimbostratus
Dec 17, 2011

iRules containing double-byte characters

When the BIG-IP system configuration with an iRule containing double-byte characters is upgraded to version 10.1.0, the system does not properly load the iRule

 

 

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"

 

  • is it sol11661?

     

     

    sol11661: The BIG-IP system does not load iRules containing double-byte characters

     

    http://support.f5.com/kb/en-us/solutions/public/11000/600/sol11661

     

     

    ID224742 - irule multi-language support broke in 10.1.0 (Formerly CR 137529) is fixed in 11.0.0.
  • George_Watkins_'s avatar
    George_Watkins_
    Historic F5 Account
    One 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,

     

     

    George
  • George, nice tip! thanks.

    this works for me.

    [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"
    }
    }