Dossy,
Here are the steps to replicate the problem 1. you need a table with some multibyte characters in it. You can do this either by 1.1.1 create table multibytetest (value nvarchar(200)) 1.1.2 Pasting some Chinese characters via SQL Server Management Studio Express OR using the attached java file (you will need SQL Server JDBC driver available from here<http://www.microsoft.com/downloads/details.aspx?FamilyId=C47053EB-3B64-4794-950D-81E1EC91C1BA&displaylang=en>) 1.2.1 Copy the attached InsertMultiByte.java. 1.2.2 javac -classpath . InsertMultiByte.java 1.2.3 java -classpath ".;sqljdbc.jar" InsertMultiByte <SQLServerHost> <SQLServerPort> <DatabaseName> <username> <password> 3. Copy the attached multibytetest.adp1 as multibytetest.adp into your aolserver adp directory. Ensure the mime type for adp configuration ,if configured , is set to ns_section "ns/mimetypes" ns_param default "*/*" ;# MIME type for unknown extension. ns_param noextension "*/*" ;# MIME type for missing extension. ns_param ".adp" "text/html; charset=utf-8" 4. Ensure the ns_db driver is configured to point to SQL server 3. Execute the attached adp .It is a simple adp which fires the SELECT value from multibytetest SQL and prints the last record. Expected result is for this adp to print the Chinese characters Actual result is it prints ? in place of chinese characters You can wireshark to sniff the packet between AOLServer and SQLServer to see the 2 login requests being made with the 2nd request not setting the COLLATION header. I suspect it to be the culprit. Thanks-- -- Rajesh Nair -----Original Message----- From: Dossy Shiobara [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 2:26 AM To: AOLSERVER@LISTSERV.AOL.COM Cc: Rajesh Nair Subject: Re: [AOLSERVER] [ns_db and multibyte support] On 2008.04.16, Dossy Shiobara <[EMAIL PROTECTED]> wrote: > I'll be fixing nsfreetds with the FreeTDS 0.64 version, then once we > agree everything "works" as expected, I'll try rolling forward to > FreeTDS 0.82. > > Rajesh, thanks for your interest. Okay, after a bit of fixing up, I've gotten my local copy of nsfreetds working with FreeTDS 0.64, again. My very casual test (the nsfreetds.adp in nsfreetds CVS) looks like this: SQL: SELECT db_name() dbname, user_name() username, @@servername server, @@version version, getdate() now, convert(varchar(26), getdate(), 9) nowhey, convert(varchar(8), getdate(), 1) nowtoo, convert(datetime, '12/31/1999') nowthen, convert(money, '$10.52') cha_ching, convert(numeric, '8675309') jenny_jenny, convert(real, '123.456') get_real, convert(text, 'this is some text') some_text, convert(integer, '1234567890') an_integer, convert(datetime, null) datetime_null, convert(integer, null) integer_null, convert(real, null) real_null, convert(numeric, null) numeric_null, convert(money, null) money_null, convert(varchar(10), null) varchar_null, convert(text, null) text_null Results: Row 1 ... Column 1: dbname = master Column 2: username = dbo Column 3: server = HAPPY-WIN2K3 Column 4: version = Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 2) Column 5: now = Apr 16 2008 04:07PM Column 6: nowhey = Apr 16 2008 4:07:41:773PM Column 7: nowtoo = 04/16/08 Column 8: nowthen = Dec 31 1999 12:00AM Column 9: cha_ching = 10.52 Column 10: jenny_jenny = 8675309 Column 11: get_real = 123.456 Column 12: some_text = this is some text Column 13: an_integer = 1234567890 Column 14: datetime_null = Column 15: integer_null = Column 16: real_null = Column 17: numeric_null = Column 18: money_null = Column 19: varchar_null = Column 20: text_null = Rows affected: 1 ... Rajesh, could you help me create a minimal test case to reproduce what you've observed so I can test potential fixes here? -- Dossy Shiobara | [EMAIL PROTECTED] | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
InsertMultibyte.java
Description: InsertMultibyte.java
multibytetest.adp1
Description: multibytetest.adp1