kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Error U+2019 from UTF-8 to US-ASCII #135

Closed ivanovaleksey closed 8 years ago

ivanovaleksey commented 8 years ago

Hi. I am getting this U+2019 from UTF-8 to US-ASCII error when I am trying to update description field in my object. This field has Clob type ib DB (dont know if it does matter).

I am using ruby 2.3.1.

Here is my backtrace

/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-oci8-2.2.2/lib/oci8/bindtype.rb:121:in `encode'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-oci8-2.2.2/lib/oci8/bindtype.rb:121:in `create'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-oci8-2.2.2/lib/oci8/cursor.rb:511:in `make_bind_object'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-oci8-2.2.2/lib/oci8/cursor.rb:99:in `bind_param'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:128:in `block in cursor_bind_params'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:115:in `map'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:115:in `cursor_bind_params'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:176:in `execute_prepared_statement'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:79:in `block in _execute'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/connecting.rb:251:in `block in synchronize'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/connection_pool/threaded.rb:103:in `hold'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/connecting.rb:251:in `synchronize'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:77:in `_execute'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/adapters/oracle.rb:67:in `execute'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/query.rb:52:in `execute_dui'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/dataset/actions.rb:981:in `execute_dui'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/dataset/prepared_statements.rb:33:in `execute_dui'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/dataset/prepared_statements.rb:33:in `execute_dui'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/dataset/actions.rb:827:in `update'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/dataset/prepared_statements.rb:182:in `run'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/dataset/prepared_statements.rb:55:in `call'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/plugins/prepared_statements.rb:199:in `_update_without_checking'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2114:in `_update'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2108:in `_update_columns'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2062:in `block (2 levels) in _save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1243:in `around_update'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2046:in `block in _save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1243:in `around_save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2032:in `_save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1684:in `block (2 levels) in save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2186:in `block in checked_transaction'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/transactions.rb:163:in `_transaction'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/transactions.rb:138:in `block in transaction'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/connecting.rb:251:in `block in synchronize'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/connection_pool/threaded.rb:103:in `hold'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/connecting.rb:251:in `synchronize'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/database/transactions.rb:104:in `transaction'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2186:in `checked_transaction'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1684:in `block in save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2174:in `checked_save_failure'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1684:in `save'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1697:in `save_changes'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:2350:in `update_restricted'
/Users/aleksey/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sequel-4.36.0/lib/sequel/model/base.rb:1825:in `update'

Can you help to figure it out, please?

Thank you.

kubo commented 8 years ago

Could you set the environment variable NLS_LANG?

ivanovaleksey commented 8 years ago

Thank you, @kubo. It solves the issue. I have set NLS_LANG like export NLS_LANG=AMERICAN_AMERICA.UTF8.

Sorry for yet another NLS_LANG issue. As you answered it I found similar issues.