Support UTF-8 strings #11

Merged
merged 1 commit into from Feb 12, 2014

Conversation

Projects
None yet
2 participants
@kunigaku
Contributor

kunigaku commented Mar 14, 2013

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 added a commit that referenced this pull request Feb 12, 2014

@drbrain drbrain merged commit 6b5f04e into drbrain:master Feb 12, 2014

1 check passed

default The Travis build passed
Details

drbrain added a commit that referenced this pull request Feb 13, 2014

Test for #11
The failure noted in #11 is due to using a file icon along with UTF-8
characters.  This has been recreated in a test now.

drbrain added a commit that referenced this pull request Feb 13, 2014

Replace GNTP#load_resource with URI from --icon
There appears to be no need to download the URL as growl will do it for
us if we use the existing URI support in ruby-growl instead of loading
it manually.  This mostly reverts #11, but appears to work exactly the
same.

/c @steakknife
@drbrain

This comment has been minimized.

Show comment
Hide comment
@drbrain

drbrain Feb 13, 2014

Owner

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

Owner

drbrain commented Feb 13, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment