when using the Command Line Interface via port 9090, can I make the beast talk back in plain ascii...?
I always get answers with HTML substitution characters (like %3A instead of a : or %20 for all blank etc.) which is less helpful on a user-interface that is not used with a browser normally...
Any ideas how to turn off this behaviour?
Thank,
Klaus
Results 1 to 8 of 8
Thread: CLI output as plain ascii?
-
2008-11-29, 01:02 #1Junior Member
- Join Date
- Nov 2008
- Posts
- 3
CLI output as plain ascii?
-
2008-11-29, 10:57 #2
It's URL encoded, not HTML encoded - and no, there's no way I know to switch it off. That's because plain ASCII doesn't support all the characters which might be needed (file/song names with wacky characters, etc). Don't know what you're writing your UI in but I'm sure it has a library to do URLdecode.
-
2008-11-29, 15:05 #3Junior Member
- Join Date
- Nov 2008
- Posts
- 3
...sorry, right its url...
...and no there is nothing like this (I write a interface for a Crestron controller)... About 80% of my processor-cycles (and there aren't too many...) I'm wasting with things like:
While (Find ("\x253A", work, 1) > 0) // while there are %3A
{ Work = mid(work, 1, Find ("\x253A", work, 1) - 1) + ":" +
mid(work, Find("\x253A",work,1)+3,
len(work)-1-Find "\x253A",work,1));
}
This is to replace %3A with a simple : ... I'd neet to do this for ??? characters. In the end the whole interface tends to be unusable because of this...
And I can't see the sense of url-encoding it. When its UTF-8, then just output UTF-8...
KlausLast edited by nine11turbo; 2008-11-29 at 15:09.
-
2008-11-30, 17:27 #4
I've seen other Crestron modules around for SC, so it must be possible. Typically when doing a URL decode you wouldn't have a block like that for each different character, you'd look for %, and take the next 2 chars as a character code, then replace all 3 with the appropriate symbol. As for why it was chosen, my guess is for ease of delimitation. It's done in URLs because ":", "/" etc have special meaning, and it's the same here. Space for example is often used as a delimiter so if you have a space in a value it needs to be escaped. I guess URL encoding was just seen as convenient as it's a pretty widely understood scheme.
-
2008-11-30, 18:02 #5Senior Member
- Join Date
- Oct 2005
- Posts
- 2,769
http://www.tux.org/~peterw/
Note: The best way to reach me is email or PM, as I don't spend time on the forums.
Free plugins: AllQuiet Auto Dim/AutoDisplay BlankSaver ContextMenu DenonSerial
FuzzyTime KidsPlay KitchenTimer PlayLog PowerCenter/BottleRocket SaverSwitcher
SettingsManager SleepFade StatusFirst SyncOptions VolumeLock
-
2008-11-30, 20:33 #6
-
2008-11-30, 20:58 #7
URI-unescaping is simple and fast. It only takes one line of Perl to do it. I'm sure you can find a similarly easy way to do it in whatever language you're using.
$string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
-
2008-12-01, 06:33 #8Junior Member
- Join Date
- Nov 2008
- Posts
- 3
if there would be something like RegEx in Crestron world it would be easy
Thanks for all input but I think the way to go is to "offload" the parsing to the server where SqueezeCenter is running... Any hints where to look how to get a Netgear ReadyNAS to execute Pearl (or semething else like Python)scripts through a Telnet interface? This way the scripts could get the info from Squeezecenter, do all character conversion etc and deliver formatted text as I need it...?
thanks for all help
Klaus

Reply With Quote


