URL-encoding - very common when you do not want embedded spaces to confuse the parsing of data.
UTF-8 - from 2nd paragraph in the built-in documentation in LMSAccented chars also: Ga%C3%ABtan
What kind of coding is it ?
"For strings, Logitech Media Server uses the UTF-8 character-set encoding."
No. I expect you will be able to find a UTF8 handling library - or just map the few accented characters that you know you will see if you do not plan to make this available to anyone else.Is it possible to configure it to ASCII ?
Results 31 to 37 of 37
-
2022-01-24, 09:29 #31
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 5,500
Last edited by Paul Webster; 2022-01-24 at 09:54.
Paul Webster
Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin
-
2022-01-24, 09:35 #32
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,543
It is known HTML encoding, HTML escaping, HTML URL encoding or percent encoding. https://www.w3schools.com/tags/ref_urlencode.asp
Two reason
1. Spaces are significant as a separator of keyword/parameters to distinguish from LMS values returned
2. Data from LMS is UTF8 and so non ASCII with accented/foreign characters (e.g. chinese ) are in values returned.
So HTML encoding so spaces and UTF8 characters in LMS returned values can be passed on accurately.
Ga%C3%ABtan = GaëtanLast edited by bpa; 2022-01-24 at 09:38. Reason: clarify 2nd point
-
2022-01-24, 09:44 #33
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,543
MAC address of ther player - %3A is a colon
dc%3Aa6%3A32%3A75%3A45%3A0a = dc:a6:32:75:45:0a
Code:title ? dc%3Aa6%3A32%3A75%3A45%3A0a title WOULD%20I%20LIE%20TO%20YOU
dc:a6:32:75:45:0a title WOULD I LIE TO YOU
See in WebUI - Help (bottom Left) - Technical Information - Command line ReferenceLast edited by bpa; 2022-01-24 at 10:14.
-
2022-01-25, 06:28 #34
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
I saw this thread about the LCD display, but in German. https://forums.slimdevices.com/showt...l=1#post816678
But it seems that into the readsq.py an UTF8/HTML decoding is done.
Is it possible to adapt it ?
Thanks
-
2022-01-25, 06:48 #35
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,543
I told you about readsq.py a many post ago.
It uses the Python library to decode the HTML encoded string into the internal Python string (which supports UTF8).
You're going in circles.
Output from a modified readsq has to go out on the serial port but as discussed earlier PCP micropython doesn't support threading or perhaps pyserial. Which is why "nc" is being used.Last edited by bpa; 2022-01-25 at 06:56. Reason: typos
-
2022-01-25, 06:54 #36
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
-
2022-01-25, 07:15 #37
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,543