Dealing with "%u" encoding string in params in IG

Hi,
It looks like IG has a limitation let it cannot process URL with params including “%u” encoding, such as “https://abc.com/?name=%u65E5%u672C%u8A9E”. While dealing with such URL IG will return 400 Invalid URI Syntax error.
Has anyone encounter this issue? It seems to be a common usage in Asia region like for Japanese or Chinese, how do you deal with such issue?

Hi brucechen,

I believe %u is UTF-16 which is not officially (W3C) recognised for URL character encoding. You would have to switch to UTF-8.
I hope this helps.

1 Like

Hi Brucechen,

I have an app going through IG which does this too. I agree with Gery that this is not a valid URL encoding.
Eventually, the app vendor accepted that it was a bug, but it was going to be a while before a fix was released, so I worked around it with a simple scriptable filter at the beginning of my filters,
{
“name” : “FixupFilter”,
“type” : “ScriptableFilter”,
“config” : {
“type” : “application/x-groovy”,
“source” : [
“request[‘entity’].setString(request[‘entity’].getString().replace(’%u’,’%25u’))”,
“return next.handle(context, request)”
]
}
}

And the reverse at the end.

1 Like