I have this error in my /etc/i3blocks.conf
Error: Could not parse JSON (lexical error: invalid bytes in UTF8 string.)
My code in /etc/i3blocks.conf
looks like this.
[rss]
command=rsstail -n1 -1 -N -u https://stackexchange.com/feeds/questions | head -c 50
color=#00FF00
interval=300
[rss]
command=rsstail -n1 -1 -N -u https://unix.stackexchange.com/feeds | head -c 50
color=#00FF00
interval=60
[rss]
command=rsstail -n1 -1 -N -u https://softwarerecs.stackexchange.com/feeds | head -c 50
color=#00FF00
interval=300
[rss]
command=rsstail -n1 -1 -N -u https://news.ycombinator.com/rss | head -c 50
color=#00FF00
interval=300
It's because RSS title contains not allowed characters. Otherwise I have not this error.
How can I fix or handle this error in my /etc/i3blocks.conf
? So that, if one RSS channel doesn't work, the other three will work?
command=LC_ALL=en_GB.utf8 rsstail ...
.i3-msg restart
I have the same error. Shouldn't second=
be excaped somehow?=
is escaped. You might try piping the rsstail output throughiconv -f UTF-8 -t ASCII//TRANSLIT
, which should replace the bad code with something in ascii. If you prefer useiso-8859-15
instead of ascii. Do this before thehead
. Note:head
might cause a problem as it could cut off a utf8 sequence of bytes at midpoint, creating a bad codepoint, hence the value in converting to an encoding that only uses 1 byte per char.