Escape character for Session relevance

I am trying to query fixlet ID by fixlet name . Unfortunately fixlet name has double quotes in name. Hence session relevance is failing -
relevance- (id of it) of bes fixlets whose (name of it = "fixletname")

In case of fixletname contains double quotes , this relevance fails .

I tried replacing double quotes by %22 or %2522.
Every time it get replaced by " .

I am executing query using -
http://iemserver:52311/api/query?relevance=(id of it) of bes fixlets whose (name of it = "fixletname")

This is failing-
http://iemserver:52311/api/query?relevance=(id of it) of bes fixlets whose (name of it = "fixlet%22na%22me")
http://iemserver:52311/api/query?relevance=(id of it) of bes fixlets whose (name of it = "fixlet%2522na%2522me")

Hi @Sidd

I remembered a post that has the same, so did a little digging:

Here they use %252522 … You can try that? Now idea why it should be that, but give it a try :slight_smile:

2 Likes

It’s an example of doubling-up on the escape sequences, when the escape codes will be evaluated more than once.

(name of it) of bes fixlets whose (relevance of it as lowercase contains "name of operating system as lowercase contains %252522win%252522")

First pass, (probably at the client), Relevance Substitution converts β€œ%25” to β€œ%” (25 is the hexadecimal of the ASCII code for a percent symbol). So you end up with β€œ%2522win%2522”, where the remaining β€œ25” strings are the second 25’s in each sequence.

Second pass (probably at the server), β€œ%2522win%2522” is evaluated as β€œ%22win%22” (again, β€œ%25” is translated to the percent symbol β€œ%”.

In a third pass, β€œ%2522win%2522” will be translated to β€œ%22win%22”.

Finally, β€œ%22” is the escape code for a double-quote character.

…not saying this will work, just trying to help visualize why multiple %252522 codes might be helpful.

4 Likes

Thats working !!! I was almost on same path , just missed extra 25 for second pass at server side.

2 Likes

Glad it worked. It was a super pain to figure out the first time.

Also, thanks for the explanation @JasonWalker … I’d say you are right, though I’m not exactly sure where all of the layers are that are interpreting the escaped characters.