Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


code converter not found (UTF-8 to UTF-16) #113

Shinta opened this Issue · 11 comments

11 participants

Augusto Ruibal etorrey murtyk Sjors Provoost Syed Aamir Naqib Dan Oved Ryan Wallace blackbumer pmahoney Alan Justino da Silva jimmykarily
Augusto Ruibal

I think this issue is fixed in the version 3.0, but is happening to me right now, I love Exception Notification, can some one tell me what can i do?


I had this same problem using jruby 1.7.0. Which generated an interesting (hundreds of jruby internal lines of stacktrace) exception:

ActionView::Template::Error (Illegal replacement):

This line in the default /views/exception_notifier/exception_notification.text.erb view is throwing the exception:

sections = sections.force_encoding('UTF-8').encode('UTF-16', :invalid => :replace).encode('UTF-8') if sections.respond_to?(:force_encoding)

I just copy/pasted the view into my normal application directory under app/views/exception_notification.text.erb with that line removed. Hope that helps!


check issues 103 and 111

Sjors Provoost

#103 is closed, but I'm still experiencing this issue. I'm using Ruby 1.9.3 on Heroku Cedar. As suggested on Stack Overflow the fork by @alanjds makes the problem go away.

Sjors Provoost

That said, when I do:
brew link --overwrite sphinx

it doesn't complain and Sphinx works fine (and it uses MySQL).

Syed Aamir Naqib
san commented

I got the latest code including fixes for #103 and #111 but I am still getting the error mentioned by @etorrey under jRuby 1.7.0. Removing the line as mentioned by @etorrey works.

Dan Oved

I get this error too.

Ryan Wallace

You need to use the version from github as the fix is in the code but not released in a gem yet. See #111.


i've used gem from github but still have been afected by this bug (with jruby 1.7.2)


The JRuby issue is a different issue. There is a bug in JRuby which makes .encode('UTF-16', :invalid => :replace) fail in 1.9 mode. Unfortunately, the JRuby devs have indicated a fix for this is difficult.

@smartinez87 I have been fiddling around trying to change exception_notification to not trigger this bug in JRuby. It's easy enough to simply not go through the multiple conversion steps, but obviously they are there to fix issues #52 and #86.

But I have been unable to reproduce the exception seen in those issues. I've tried adding various tests that include UTF-8 check marks forced to UTF-8, ASCII-8BIT, etc. I've tried setting the dummy app to not default to "utf-8". Is there any known way to reproduce these issues? I'd really like to get exception_notification working in JRuby, but I'm guessing a pull request that simply ripped out the encoding pipeline would be rejected.

Thank you.

Alan Justino da Silva

I agree with @pmahoney: this fixes MY problem only. Have no tests attached, and for sure it breaks non-standard Ruby VM or non-x86 archtectures.


Someone with more Ruby knowledge please write at least some basic tests, so people can say where it works/breaks. Its far from my field now.


And now I got incompatible character encodings: ASCII-8BIT and UTF-8 on version 4.0.1.
Let's switch it again :-p . I'll try to see what causes this and maybe find an easy way to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.