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

Closed
Shinta opened this Issue Nov 22, 2012 · 12 comments

Comments

Projects
None yet

Shinta commented Nov 22, 2012

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?

etorrey commented Nov 27, 2012

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):
  java.nio.charset.CharsetEncoder.replaceWith(CharsetEncoder.java:285)

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!

murtyk commented Dec 17, 2012

check issues 103 and 111

Sjors commented Dec 31, 2012

#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 commented Dec 31, 2012

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

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

san commented Jan 8, 2013

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.

oveddan commented Jan 11, 2013

I get this error too.

rywall commented Jan 14, 2013

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

danil-z commented Jan 15, 2013

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.

alanjds commented Feb 9, 2013

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.

Beware!

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.

Collaborator

san650 commented Dec 14, 2015

Hi!

I'm doing some bug triage and I would like to know if this bug is still happening on master.

The idea is to close those errors that can't be reproduced or that don't have enough information to reproduce it. I'll revisit this bug in a week and I'll close it if there's no more information. It can be opened again later if necessary.

Thanks!

san650 closed this Dec 19, 2015

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