drbrain / ruby-growl

Pure-Ruby Growl Notifier
49 stars 10 forks source link

Support UTF-8 strings #11

Closed kunigaku closed 10 years ago

kunigaku commented 11 years ago

Fix bug for utf-8.

# -*- encoding: utf-8 -*-
require 'ruby-growl'
require 'ruby-growl/ruby_logo'

g = Growl.new "localhost", "ruby-growl"
g.add_notification("notification", "ruby-growl Notification",
                   Growl::RUBY_LOGO_PNG)
g.notify "notification", "It came from ruby-growl", "UTF-8の文字列を送信"
/Users/kunigaku/src/ruby-growl/lib/ruby-growl/gntp.rb:336:in `join': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /Users/kunigaku/src/ruby-growl/lib/ruby-growl/gntp.rb:336:in `packet'
    from /Users/kunigaku/src/ruby-growl/lib/ruby-growl/gntp.rb:376:in `packet_notify'
    from /Users/kunigaku/src/ruby-growl/lib/ruby-growl/gntp.rb:269:in `notify'
    from /Users/kunigaku/src/ruby-growl/lib/ruby-growl.rb:305:in `notify_gntp'
    from /Users/kunigaku/src/ruby-growl/lib/ruby-growl.rb:285:in `notify'
    from rg.rb:8:in `<main>'
drbrain commented 10 years ago

Oops, @86c1eeb was mis-tagged for this issue.