Be sure to add the following in environment.rb:
ENV['NLS_LANG'] = 'AMERICAN.UTF8'
$KCODE = 'u'
require 'jcode'
Also, in your html pages, put this in the <head> section:
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=UTF-8">
This setup should ensure correct transmission of special characters to the DB.
Another problem is that the special symbols can be correctly inserted in the DB
but wrongly displayed either by SQLPlus or by your terminal. Set the NSL_LANG
variable in your shell before launching SQLPlus. For the terminal wrongly
displaying characters, I do not know enough to tell you what to do.
-----Original Message-----
From: rails-bounces@lists.rubyonrails.org
[mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Sitsofe Wheeler
Sent: Friday, September 30, 2005 2:22 PM
To: rails@lists.rubyonrails.org
Subject: [Rails] Oracle Ruby/oci8 and extended characters
Hello,
I have set up the Ruby/oci8 adaptor with the instant client on Linux with rails
and all appeared to be working well until I tried to insert a UK pound symbol
(£) into the database. Upon checking what was being inserted into the database
with SQL Plus I found that the database thought that ¿¿ had been inserted.
Attempting something similar with a Euro (€) had resulted in ¿¿¿ being inserted
into the database.
Inserting a £ symbol into the database using SQL Plus and trying to read it back
via rails resulted in a # being printed.
Has anyone else had this experience? Is there a way of specifying charsets so
that this doesn't happen?
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo!
Security Centre. http://uk.security.yahoo.com
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails