Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSSQLServer Unicode Support



On Oct 10, 2006, at 2:24 PM, Dov Rosenberg wrote:

In order to store unicode data into one of these columns it is necessary to preface the value with an N such as

    INSERT into locale (recordid, localedesc) values (123, N’日本語');

Otherwise only ??? Will be stored in the database. In order to find the data again you must also preface the values in the WHERE clause with N like:

    SELECT * from locale where localedesc like N'日本%';

I think I need to either modify the SQL being generated by the MSSQL Server plugin or modify the plugin itself to generate the correct SQL. Any thoughts on the correct direction would be appreciated (as well as some guidance on what and where I need to start).

It's been a while since I've done something like this, but I think you'll first need to subclass MicrosoftPlugIn (e.g., "MSUnicodePlugin") and override its defaultExpressionClass() method to return the Class object of your MSUnicodePlugin inner class MicrosoftPlugIn.MicrosoftExpression subclass (e.g., "MSUnicodePlugin.MSUnicodeExpression").  In MSUnicodePlugin.MSUnicodeExpression, override formatValueForAttribute().  Get the value returned by super.formatValueForAttribute().  If the attribute's externalType is "nchar", "ntext", or "nvarchar", prepend "N" to the value before returning it.

Then you'll need to ensure that EOF uses MSUnicodePlugin.  The tech note at <http://developer.apple.com/technotes/tn/tn2027.html> should provide enough info to make this happen.

Aloha,
Art

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden

References: 
 >MSSQLServer Unicode Support (From: Dov Rosenberg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.