Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove encoding dance to avoid JRuby bug #126

Closed
wants to merge 2 commits into from

4 participants

@pmahoney

Hi,
There is a bug in JRuby that prevents changing string encoding with the :invalid => :replace option. The JRuby developers have indicated a fix is not easy (and presumably unlikely to come any time soon).

This patch removes these calls from exception_notification, but obviously they were added for a reason. Unfortunately, I have been unable to reproduce the errors that prompted this code's inclusion in the first place. (#52, #86).

As it is, with my pull request in place, all unit tests pass in Ruby 1.8.7, Ruby 1.9.3, and JRuby 1.7.2. Without my patch, the tests fail on JRuby.

Do you have any way of reproducing #52 or #86? It'd be great if there was a unit test in place, then I could work around the JRuby issue without breaking MRI edge cases. I'd really like to get this working JRuby.

@yobi1990

+1 to get this merged :)

@jweslley
Collaborator

Merged. Thanks @pmahoney !

@jweslley jweslley closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2013
  1. Use 'bundle exec' to setup dummy app; avoids conflict with new rake v…

    Patrick Mahoney authored
    …ersion.
This page is out of date. Refresh to see the latest.
View
2  Rakefile
@@ -6,7 +6,7 @@ require 'rake/testtask'
task 'setup_dummy_app' do
unless File.exists? "test/dummy/db/test.sqlite3"
Bundler.with_clean_env do
- sh "cd test/dummy; bundle; rake db:migrate; rake db:test:prepare; cd ../../;"
+ sh "cd test/dummy; bundle; bundle exec rake db:migrate db:test:prepare; cd ../../;"
end
end
end
View
1  lib/exception_notifier/views/exception_notifier/background_exception_notification.html.erb
@@ -18,7 +18,6 @@
"#{title}\n\n#{summary.gsub(/^/, " ")}\n\n"
end
end.join
- sections = sections.force_encoding('UTF-8').encode('UTF-16LE', :invalid => :replace).encode('UTF-8') if sections.respond_to?(:force_encoding)
%>
<%= raw sections %>
</pre>
View
1  lib/exception_notifier/views/exception_notifier/background_exception_notification.text.erb
@@ -10,6 +10,5 @@
"#{title}\n\n#{summary.gsub(/^/, " ")}\n\n"
end
end.join
- sections = sections.force_encoding('UTF-8').encode('UTF-16LE', :invalid => :replace).encode('UTF-8') if sections.respond_to?(:force_encoding)
%>
<%= raw sections %>
View
1  lib/exception_notifier/views/exception_notifier/exception_notification.html.erb
@@ -27,7 +27,6 @@
[title, summary.gsub(/^/, " "), nil].join("\n\n")
end
end.join
- sections = sections.force_encoding('UTF-8').encode('UTF-16LE', :invalid => :replace).encode('UTF-8') if sections.respond_to?(:force_encoding)
%>
<%= raw sections %>
View
1  lib/exception_notifier/views/exception_notifier/exception_notification.text.erb
@@ -19,7 +19,6 @@
[title, summary.gsub(/^/, " "), nil].join("\n\n")
end
end.join
- sections = sections.force_encoding('UTF-8').encode('UTF-16LE', :invalid => :replace).encode('UTF-8') if sections.respond_to?(:force_encoding)
%>
<%= raw sections %>
Something went wrong with that request. Please try again.