ingard
Oct 20, 2008Nimbostratus
encoding query text from utf-8 to iso8859-1 (latin1)
Hi
I have a situation where i do some redirects to other partner websites based on hostname in an irule. To these websites I also pass a query string. However, one of the partner sites does not support utf-8 encoding, so I need to encode the query string to latin1/iso8859-1 before passing it to this particular site. I tried with something like this:
.
.
lets try to extract the query
regexp {q=(.+)} $uri -> q
if {[info exists q]} {
set qiso [encoding convertto latin-1 $q]
.
.
which gives me the following error:
TCL error: irule_abcsok_rewrites_1881 HTTP_REQUEST - invalid command name encoding while executing encoding convertto latin-1 $q
Any ideas?
regards
ingard