I cannot seem to get the encoding right on my Oracle RoR combi. The information in the Oracle database seems to be encoded correctly. When looking up an attribute via SQL in need of special encoding I get eg 'Straße' which is what I expect. When requesting that same attribute from my RoR application I get 'Stra?e' which obviously is incorrect.
AMERICAN_AMERICA.AL32UTF8
utf8
AL16UTF16
I tried a couple of different things by changing the parameters above but nothing worked.
Anybody have a good idea?
Add ENV['NLS_LANG'] ||= 'AMERICAN_AMERICA.UTF8'
to ...\config\boot.rb
and it will work on all environments.
None of the solutions I could find on the web worked, but after reading the source of the ruby-oci8 gem, putting:
ENV['NLS_LANG'] = 'AMERICAN_AMERICA.AL32UTF8'
DEFAULT_OCI8_ENCODING = 'utf-8'
in config\boot.rb
worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With