zerowidth / camper_van

A Campfire to IRC bridge
MIT License
129 stars 25 forks source link

Dies when using non-ascii chars in message #12

Closed ku1ik closed 11 years ago

ku1ik commented 12 years ago

When I tried to send a message:

próbowałem flamethrower'a, ale coś gubił wiadomości i się wywalił na nicku z "Ł"

it dies with error:

2012-04-27 16:00:37  9020  INFO CamperVan : closed connection from 127.0.0.1
2012-04-27 16:00:37  9020 ERROR CamperVan : http error . Trying again in 2 seconds...
2012-04-27 16:00:37  9020 ERROR CamperVan : http error . Trying again in 2 seconds...
/home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/channel.rb:127:in `sub': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/channel.rb:127:in `privmsg'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/ircd.rb:213:in `block in <class:IRCD>'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/command_definition.rb:59:in `handle'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/ircd.rb:67:in `receive_line'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/server.rb:97:in `receive_line'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/eventmachine-0.12.10/lib/em/protocols/linetext2.rb:64:in `receive_data'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/lib/camper_van/server.rb:21:in `run'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/gems/camper_van-0.0.3/bin/camper_van:64:in `<top (required)>'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/bin/camper_van:19:in `load'
        from /home/kill/.rvm/gems/ruby-1.9.2-p318/bin/camper_van:19:in `<main>'
zerowidth commented 12 years ago

I can't reproduce this on ruby 1.9.3p125 with the latest firering gem. Do you have any suggestions?

ku1ik commented 12 years ago

I tried it now on 1.9.2 and it worked. But I think I know what may be the case. When I was sending this messages I was sending it to nick micha_wr_bel. So the full messages looked like:

micha_wr_bel: próbowałem flamethrower'a, ale coś gubił wiadomości i się wywalił na nicku z "Ł"

Thing is the real name of this guy is Michał Wróbel. It contains non-ascii chars and maybe when doing nickname translation from irc nick to real name it couldn't handle encoding difference. Might that be the case? I strongly believe so.

Also I'd prefer to have irc nickname for this dude as michał_wróbel. Bu that's another pair of shoes and subject for different issue to be opened maybe.

zerowidth commented 11 years ago

Closing pending further detail. If you can give me instructions to reproduce this bug, I'll take a look.