Forum Discussion

nag_54823's avatar
nag_54823
Icon for Cirrostratus rankCirrostratus
Aug 23, 2017

URI::encode doesn't encode brace characters

Hi All,

 

I'm trying to encode an URL using URI::encode in IRULE. But it didn't encoded characters ( and ). Could you please help me to encode these characters with %28 and %29 respectively.

 

  • Hi,

    weird behavior tested in both 11.5.4 and 13.0 versions... you can try string map:

    when RULE_INIT {
        set test "(this is a test)"
        set test2 [URI::encode $test]
        set test3 [string map {"(" "%28" ")" "%29"} $test2]
        log local0. "$test $test2 $test3"
    
    }