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

Encoding::CompatibilityError: incompatible encodings: UTF-8 and ASCII-8BIT #3521

Closed
nadavshatz opened this issue Dec 7, 2015 · 3 comments
Closed

Comments

@nadavshatz
Copy link

Encoding::CompatibilityError: incompatible encodings: UTF-8 and ASCII-8BIT

  from active_record/callbacks.rb:306:in `block in _create_record'
  from active_record/attribute_methods/dirty.rb:132:in `_create_record'
  from active_record/locking/optimistic.rb:75:in `_create_record'
  from active_record/counter_cache.rb:139:in `_create_record'
  from active_record/persistence.rb:524:in `_create_record'
  from active_record/relation.rb:64:in `insert'
  from active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
  from active_record/connection_adapters/abstract/database_statements.rb:107:in `insert'
  from active_record/connection_adapters/abstract/database_statements.rb:13:in `to_sql'
  from active_record/connection_adapters/abstract_adapter.rb:116:in `compile'
  from arel/collectors/bind.rb:32:in `compile'
  from org/jruby/RubyArray.java:1789:in `join'
  from org/jruby/RubyArray.java:1783:in `join'

I've narrowed the issue down and I'm not sure if this should be opened here or under arel.

I'm using arel 6.0.3 and Jruby 9.0.4.0 with rails 4.2.5

It looks like arel is building an insert statement with some UTF-8 characters and it fails with this exception when it tries to join it at https://github.com/rails/arel/blob/master/lib/arel/collectors/bind.rb#L32
I'm guessing that some of the strings are generated as ASCII and that's what causes the exception.

@kares
Copy link
Member

kares commented Jun 23, 2017

is this still relevant? if so we would need a way of reproducing - currently I do not see a way to proceed.

@nadavshatz
Copy link
Author

@kares It is.
I'll try and look into an easy way to reproduce.
Cheers

@nadavshatz
Copy link
Author

very stale

@kares kares added this to the Invalid or Duplicate milestone Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants