Forum Discussion

Manuel_Gabaldon's avatar
Manuel_Gabaldon
Icon for Nimbostratus rankNimbostratus
Jul 18, 2006

Change in character set when replacing payload content

Hi, I'm using an iRule to rewrite the payload in server responses

 

 

rule rewrite host_and_paths {

 

when HTTP_RESPONSE {

 

if {([HTTP::status] == 200)

 

&&(([HTTP::header Content-type] starts_with "text/")

 

|([HTTP::header Content-type] starts_with "application/x-javascript"))}{

 

HTTP::collect [HTTP::header Content-Length]

 

}

 

}

 

 

Change references from apps.foo.com to www.foo.com/apps

 

 

when HTTP_RESPONSE_DATA {

 

set clen [HTTP::header Content-Length]

 

set newPayload [string map {"apps.foo.com" "www.foo.com/apps"} [HTTP::payload]]

 

HTTP::payload replace 0 $clen $newPayload

 

HTTP::release

 

}

 

}

 

}

 

 

For some reason, Latin characters like "é" or "ó" don't appear correctly. They only appear correctly when forcing the browser to use Unicode as character enconding.

 

 

Do you know why is this happening?

 

 

Regards.

 

 

--Manu.

4 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    I believe I've seen a previous posting that listed a similar side-effect. I'll try and track down other similar examples. If there's a trend, I'll see if I can look into this a bit further and get you an answer.

     

     

    Colin
  • I'm facing similar problem. I've posted more on this subject here : http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=722815878