Hi,
I have been encountering this error when I try to save text with
japanese characters:
DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Line 1: Incorrect syntax near ''20070730''.
HRESULT error code:0x80020009
Exception occurred.: INSERT INTO categories ([category_name],
[updated_at], [created_by], [updated_by], [description], [created_at])
VALUES(''費用区分'', ''20070730 13:57:25'', 1001,
1001, ''Expense '', ''20070730
13:57:25'')
I have done all of the thing needed that makes rails support for
unicode, like installing the unicode_0.1 gem, adding the $KCODE =
''u'' in
the environment.rb and
in the ApllicationController I have added:
before_filter :set_charset
def set_charset
@headers["Content-Type"] = "text/html; charset=utf-8"
suppress(ActiveRecord::StatementInvalid) do
ActiveRecord::Base.connection.execute ''SET NAMES UTF8''
end
end
Also I have put encoding: utf8 in my database.yml
But still I get the error.
What am I doing wrong?
All reply i greatly appreciated. Thanks.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---