Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Encoding object for Encoding.compatible? #457

Merged
merged 1 commit into from Jan 5, 2013

Conversation

Projects
None yet
2 participants
@kou
Copy link
Contributor

kou commented Dec 20, 2012

With this change, the following calls are supported:

Encoding.compatible?(Encoding.find("UTF-8"),
                     "US-ASCII")
# => #<Encoding:UTF-8>

Encoding.compatible?("UTF-8",
                     Encoding.find("US-ASCII"))
# => #<Encoding:UTF-8>

Encoding.compatible?(Encoding.find("UTF-8"),
                     Encoding.find("US-ASCII"))
# => #<Encoding:UTF-8>

The following calls are supported before this changes:

Encoding.compatible?("UTF-8",
                     "US-ASCII")
# => #<Encoding:UTF-8>
@kou

This comment has been minimized.

Copy link
Contributor Author

kou commented Dec 20, 2012

Sorry. The example isn't correct. Please ignore it.

The following calls are supported before this changes:

Encoding.compatible?("UTF-8",
                     "US-ASCII")
# => #<Encoding:UTF-8>
Accept Encoding object for Encoding.compatible?
With this change, the following calls are supported:

    Encoding.compatible?(Encoding.find("UTF-8"),
                         "String".force_encoding("UTF-8"))
    # => #<Encoding:UTF-8>

    Encoding.compatible?("String".force_encoding("UTF-8"),
                         Encoding.find("US-ASCII"))
    # => #<Encoding:UTF-8>

    Encoding.compatible?(Encoding.find("UTF-8"),
                         Encoding.find("US-ASCII"))
    # => #<Encoding:UTF-8>

BanzaiMan added a commit that referenced this pull request Jan 5, 2013

Merge pull request #457 from kou/support-encoding-object-for-encoding…
…-compatible-p

Accept Encoding object for Encoding.compatible?

@BanzaiMan BanzaiMan merged commit cc90601 into jruby:master Jan 5, 2013

1 check passed

default The Travis build passed
Details
@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Jan 5, 2013

Thank you!

@kou kou deleted the kou:support-encoding-object-for-encoding-compatible-p branch Jan 5, 2013

grosser pushed a commit to grosser/test-unit that referenced this pull request Dec 20, 2013

Add workaround for Encoding.compatible? on JRuby 1.7.1
The JRuby's problem will be fixed because a pull request has been sent:
  jruby/jruby#457
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.