Home of the Squeezebox™ & Transporter® network music players.
Page 4 of 4 FirstFirst ... 234
Results 31 to 37 of 37
  1. #31
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    5,817
    Quote Originally Posted by PaulH View Post
    it is also curious to see how the spaces are managed with %20 !
    URL-encoding - very common when you do not want embedded spaces to confuse the parsing of data.

    Accented chars also: Ga%C3%ABtan
    What kind of coding is it ?
    UTF-8 - from 2nd paragraph in the built-in documentation in LMS
    "For strings, Logitech Media Server uses the UTF-8 character-set encoding."

    Is it possible to configure it to ASCII ?
    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.
    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

  2. #32
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by PaulH View Post
    dc%3Aa6%3A32%3A75%3A45%3A0a title WOULD%20I%20LIE%20TO%20YOU[/CODE]

    it is also curious to see how the spaces are managed with %20 !
    Accented chars also: Ga%C3%ABtan
    What kind of coding is it ?
    Is it possible to configure it to ASCII ?
    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Űtan
    Last edited by bpa; 2022-01-24 at 09:38. Reason: clarify 2nd point

  3. #33
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by PaulH View Post
    The output is a little strange;
    What does dc%3Aa6%3A32%3A75%3A45%3A0a mean ?
    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
    Response syntax - <MAC address><SP><responsetype><SP><VALUE>
    dc:a6:32:75:45:0a title WOULD I LIE TO YOU


    See in WebUI - Help (bottom Left) - Technical Information - Command line Reference
    Last edited by bpa; 2022-01-24 at 10:14.

  4. #34
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by bpa View Post
    It is known HTML encoding, HTML escaping, HTML URL encoding or percent encoding. [url]https://www.w3schools.com/tags/ref_urlencode.asp[/url
    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

  5. #35
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by PaulH View Post
    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 ?
    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

  6. #36
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by bpa View Post
    I told you about readsq.py a many post ago.
    It uses the Python library to deocde the HTML encoded string into the internal Pyhtoin 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.
    Ok, I will decode that on my HA.

  7. #37
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by PaulH View Post
    Ok, I will decode that on my HA.
    If it is Arduino based - there are many example C solution for URL decoding / percent decoding already available.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •