Closed Nanomani closed 1 week ago
If for you it is no sense or not clear or too many works for a limited case I understand. I guess the difficulty is how this works because in some case there is "+" in encoded value to replace a "space" So please feel free to close this issue :)
How are you testing this?
The function passes the string to pythons urllib encoding function (quote_plus) which should percent encode plus signs. The function encodes space to plus, and plus to percent.
It sounds like however you're testing this is decoding the string.
I use this feature "Get Encoded String" in "DialogVideoInfo.xml" with <onload>
in same way for encode :
this help in some case to display list item by (set, studio) from my local db
label.set contain sometime a & (eg : "fast & Furious - saga")
<onload>RunPlugin("plugin://script.skinvariables/?info=get_encoded_string&window_id=Home&window_prop=Encoded.ListItem.Set&&$INFO[ListItem.Set]")</onload>
For this case all works well :
label.studio contain sometime a + (eg : "Apple TV+")
<onload>RunPlugin("plugin://script.skinvariables/?info=get_encoded_string&window_id=Home&window_prop=Encoded.ListItem.Studio&&$INFO[ListItem.Studio]")</onload>
For this case this seems not working :
I guess it is big missunderstaning in my side. But I have absoluty no idea where I m wrong in my code ?
Anyway thanks again for your time and I will close this in few days.
Just to be sure of my code I have tested with a label.studio with some "Special Characters" but without +
eg : Agat Films & Cie / Ex Nihilo
All works fine :
definitively I don't understand why "+" is not encoded when is present in label ...
I think the + is being turned into a space before it reaches the script, and then the script encodes the space on the end as a +
Above commit adds an optional param unencoded_paths=true
to prevent paths after &&
being decoded before running through the script (i.e. will prevent the +
being decoded to a space before the script runs to encode it).
e.g.
<onload>RunPlugin("plugin://script.skinvariables/?info=get_encoded_string&unencoded_paths=true&window_id=Home&window_prop=Encoded.ListItem.Studio&&$INFO[ListItem.Studio]")</onload>
Perfect, everything is now working as planned. Thanks a lot.
Get Encoded String (Container) seems not working with +
RunPlugin("plugin://script.skinvariables/?info=get_encoded_string&window_id=Home&window_prop=Encoded.ListItem.Studio&&$INFO[ListItem.Studio]")
eg : if
$INFO[ListItem.Studio]
is "Paramout+"`$INFO[Window(Home).Property(Encoded.ListItem.Studio)]
must displayed "Paramount%2B"but it don't there no change "Paramout+" is displayed
Anyway thanks a lot for all your addons.