whatsapi ruby encoding mismatch -
i'm using whatsapi ruby port https://github.com/ongair/whatsapi, following error trying out gem in rails console. code in utf8, know how fix this? author of gem not responding...
added: offending code in following:
.. elsif count < 256 @output += "\xf8" + count.chr .. the @output encoding utf-8
client = whatsapi::client.new("41791111111", "", "mynick") #<whatsapi::client:0x00000008ff0bb0 @phone_number="41791111111", @name="mynick", @identity="16d922bd096238946f2b5692fb01a5021eeaefab", @login_status="disconnected", @writer=#<whatsapi::bintreewriter:0x00000008fe8988 @output="">, @reader=#<whatsapi::bintreereader:0x00000008fe8550>> >> client.connect #<tcpsocket:fd 7> >> client.login "asdf" encoding::compatibilityerror: incompatible character encodings: utf-8 , ascii-8bit c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/bin_tree_writer.rb:119:in `write_token' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/bin_tree_writer.rb:72:in `write_string' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/bin_tree_writer.rb:61:in `block in write_attributes' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/bin_tree_writer.rb:60:in `each' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/bin_tree_writer.rb:60:in `write_attributes' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/bin_tree_writer.rb:27:in `start_stream' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/client.rb:54:in `do_login' c:/ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/whatsapi-31f8cd9b826a/lib/whatsapi/client.rb:44:in `login' (irb):12 c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.3/lib/rails/commands/console.rb:90:in `start' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.3/lib/rails/commands/console.rb:9:in `start' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.3/lib/rails/commands/commands_tasks.rb:69:in `console' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.3/lib/rails/commands/commands_tasks.rb:40:in `run_command!' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.3/lib/rails/commands.rb:17:in `<top (required)>' c:/users/mike/dropbox/kalenderfee/webapp/bin/rails:4:in `require' c:/users/mike/dropbox/kalenderfee/webapp/bin/rails:4:in `<top (required)>' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/ruby-debug-ide-0.4.30/lib/ruby-debug-ide.rb:86:in `debug_load' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/ruby-debug-ide-0.4.30/lib/ruby-debug-ide.rb:86:in `debug_program' c:/ruby21-x64/lib/ruby/gems/2.1.0/gems/ruby-debug-ide-0.4.30/bin/rdebug-ide:121:in `<top (required)>' -e:1:in `load' -e:1:in `<main>'
Comments
Post a Comment