$ESCINFO doesn't seem to work - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12) +--- Thread: $ESCINFO doesn't seem to work (/showthread.php?tid=355938) |
||||||||||||||||||
$ESCINFO doesn't seem to work - roidy - 2020-07-19 I'm passing Container.ShowName into a custom script to fill the content of a list like so:-
However it fails if any of the Show Titles contain an & symbol, which is to be expected, & symbols separate the parameters. So looking at the wiki I see there is an $ESCINFO version of $INFO, but changing my code to:-
Still does not work, the & symbols aren't being escaped Any ideas on how to deal with this? Thanks Edit:- So again it's just easier to do this in python using
Still doesn't explain why $ESCINFO fails to escape the string properly. RE: $ESCINFO doesn't seem to work - sualfred - 2020-07-23 $ESCINFO just escapes the whole string. Code: Superduperstring, with special chars & other stuff Code: "Superduperstring, with special chars & other stuff" In my Embuary helper script I use a small helper function to clean this quoted string: Code:
To prevent any other issues you have to quote it twice for your content call. Like so: Code: <content type="video">plugin://script.seasonjump/?action=getSeasons&showName='$ESCINFO[Container.ShowTitle]'</content> Code: <content type="video">plugin://script.seasonjump/?action=getSeasons&showName='"$INFO[Container.ShowTitle]"'</content> RE: $ESCINFO doesn't seem to work - roidy - 2020-07-23 Thank you for the reply, but unfortunately when dealing with url's and query strings wrapping the value in quotes won't work. plugin://script.seasonjump/?action=someaction&title=sometitle This is effectively a url and a query string, and the query strings parameters are separated by an & symbol, so if you want to include an & symbol in the value of one of the parameters then it needs to be correctly encoded. No amount of wrapping it in quotes will do this. For instance, and I have tested this. ?action=action1&title=my title Gets split into:
?action=action1&title=my title & some more Gets split into:
Now if we wrap it in quotes like you suggest then ?action=action1&title='"my title & some more"' Gets split into:
In order for it to work the & symbol needs to be properly encoded into %26 which $ESCINFO or wrapping with quotes does not do RE: $ESCINFO doesn't seem to work - sualfred - 2020-07-23 I'm using something like this: https://github.com/sualfred/script.embuary.helper/blob/matrix/plugin.py#L27-L41 RE: $ESCINFO doesn't seem to work - roidy - 2020-07-24 (2020-07-23, 22:39)sualfred Wrote: I'm using something like this: Thanks |