Writing to a SQLServer unicode column might need escaping
---------------------------------------------------------

                 Key: JRUBY-2117
                 URL: http://jira.codehaus.org/browse/JRUBY-2117
             Project: JRuby
          Issue Type: Bug
          Components: ActiveRecord-JDBC
    Affects Versions: JRuby 1.1RC1
         Environment: JTDS 1.2.2, SQLServer 2005, ActiveRecord-JDBC 0.7.2
            Reporter: Joern Barthel


When writing an utf8 string to a unicode column (e.g. nvarchar) with 
sendStringParametersAsUnicode=true (default and part of the connection url) the 
string might need a prefix of the form N'somedata'.

Example: INSERT INTO users ([name], [username]) 
VALUES(N'三島、数亜', N'日本') SELECT 
SCOPE_IDENTITY() AS ID

Adding this character to the quote function, line 117 of jdbc_mssql.rb, fixes 
this problem:

          "N'#{quote_string(value)}'" # ' (for ruby-mode)

No further test were done but I'll investigate this issue until Friday. As 
implied by writing 'might' in the summary this could very well be a local issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to