Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

XML Parsing - Unable to switch the encoding - SQL Parameter Expand / Collapse
Author
Message
Posted Tuesday, April 23, 2013 11:18 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 1:02 PM
Points: 368, Visits: 160
I pass an XML parameter from a C# program.
This seems to work fine if i change the encoding from utf-16 to utf-8.
Why does the XML parser fail with utf-16 as the default encoding?

I know I can use the N' :

SET @XMLContent = N'<?xml version="1.0" encoding="utf-16"?><...'

And then it works fine.

But I don't set the XML content in SQL, I set it in my C# program.

Is there a way to convert it to Unicode in the stored procedure?

Thank you.
Post #1445593
Posted Tuesday, April 23, 2013 12:17 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 1:02 PM
Points: 368, Visits: 160
Corrected it in the c# program before calling the stored proc.
Post #1445624
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse