I have an object with the following key:
However, the characters are encoded in a non-standard format that is causing my code some problems.
I saved the value of the key to a cookie, and found the following:
However, when comparing this string (using
===) with the value of the key, they are not equal.
Currently I am storing the key's value into a variable and using that variable as the key. However, I'm extremely curious as to what string I could compare the actual key with that would result in true.
Any help with this mystery would be greatly appreciated.
Best How To :
%00 is the URI-encoded UTF-8 representation of the character NUL, representing the null character. I imagine this is used here to differentiate between the actual * character and a * character which may be replaced by some library you're using.
We can get from
decideURIComponent() method, which, as the name suggests, decodes the URI-encoded character:
Based on your comments, it seems that the
key variable you're comparing against is actually this string of
length 8. I mention this, because the string
*_data you've included in your question is of
length 6, as it doesn't include the two null characters.