Patiobar icon indicating copy to clipboard operation
Patiobar copied to clipboard

Not Displaying 'Non-Standard' Characters Correctly

Open fritzhildebrand opened this issue 3 years ago • 3 comments

When displaying the artist, title or album containing non-standard characters like "&" are not displayed at all or properly. For example, for "Déjà Vu - Crosby, Stills, Nash & Young" it replaces the é and à with other characters and Crosby, Stills, Nash & Young shows as "Crosby, Stills, Nash". Interestingly, refreshing or reloading the page after the song starts results in it showing correctly.

fritzhildebrand avatar Jan 18 '22 00:01 fritzhildebrand

image An example where "Simon" should be "Simon & Garfunkel"

fritzhildebrand avatar Jan 18 '22 00:01 fritzhildebrand

is the browser not loading the proper font before you refresh? I will keep an eye out to see if it happens on my installation as I keep it up all the time on my network.

Doug-Wyman avatar Jan 18 '22 00:01 Doug-Wyman

To get this to work for me I made some changes to the eventcmd.sh file to cleanup these 'non-standard' characters using sed. This gets rid of incorrect displaying of characters such as é, á, ÷ ... clean () { query=$1 clean=$(echo $query | sed 's/ /%20/g; s/&/%26/g; s/+/%2B/g; s/é/%C3%A9/g; s/÷/%C3%B7/g; s/Ã/%C3%A0/g') echo $clean } I call this function for the $title, $artist, $album, $stationName before posting the query. As other weird characters show up I will just add them to the sed command. I am sure there are easier ways of doing this, but it works for me.

fritzhildebrand avatar Jan 19 '22 03:01 fritzhildebrand