0

I am very bad with ruby :(

I am using dashing and I have a widget that will display coming events from my google calendar using this Github

It is working as it should except that I have special letters in my language but it is just these 3 chars: å ä ö. These 3 are very common Swedish letters. So whenever there is an event containing one of those letters the widget breaks and displays nothing with the following error from logs:

scheduler caught exception:
"\xC3" from ASCII-8BIT to UTF-8
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing/app.rb:129:in `to_json'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing/app.rb:129:in `send_event'
/opt/dashboard/jobs/google_calendar.rb:28:in `block in <top (required)>'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:232:in `call'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:232:in `trigger_block'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:206:in `block in trigger'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:431:in `call'
/home/pi/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:431:in `block in trigger_job'

If I remove the event with one of those letters, error goes away. I've been trying to fix this for the past 2 hours with zero success. Can you save me stackoverflow? :D

edit: Best case: The widget displays the text with the special chars (å ä ö) Worst case: The ö is converted to o and å ä to a

Thanks in advance, its getting late over here so I have to sleep for now but I am eager to solve this tomorrow after work!

Sebastian S
  • 317
  • 1
  • 4
  • 7
  • 1
    Here's a related issue: https://github.com/Shopify/dashing/issues/242 I'm not sure the fix there will solve your problem, but it's worth a shot. – Jordan Running Feb 10 '16 at 21:13
  • I took a quick look, but I didnt find the location of the.bash_profile or .zshrc file.. Where is it located? – Sebastian S Feb 10 '16 at 21:28
  • In your home directory (assuming you're not on Windows, in which case it won't help you). You can also just type those commands in your terminal to test them (they won't be permanent). – Jordan Running Feb 10 '16 at 21:29
  • I am running this on a rasperry pi 2, I have not found out how to search files good yet. in my pi/home folder there is: .bash_history, .bash_logout, .bashrc .gemrc .gitconfig .profile Is it any of these files? – Sebastian S Feb 10 '16 at 21:37
  • 1
    It sounds like your input is not encoded as UTF-8, but the app expects it to be. Or maybe it's something even more confusing to do with character encoding. Char encoding problems are very challenging to debug. It's definitely a character encoding issue. If people are copy-pasting things into google calendar that are not in UTF-8, it's going to be a mess, and I'm not sure what you can do. If you could figure out what encoding your users are using, and they are always using it, you could probably somehow put something in front of dashing to convert it to UTF-8 first thing. – jrochkind Feb 10 '16 at 21:41
  • It is just my personal calendar at the moment, with Swedish holidays, special days and such for now. I think that "**ISO 8859-1**" apparently also know as **latin-1** is what we use.. – Sebastian S Feb 10 '16 at 21:49
  • Damn, still struggeling.. Any more ideas? – Sebastian S Feb 11 '16 at 18:01

0 Answers0