UTF32 and XML Datatype

  • Thread starter Thread starter Evan Camilleri
  • Start date Start date
E

Evan Camilleri

I need to add a UTF32 xml file to an XML datatype (basically I want unicode characters in there)
is it possible?

When I do
SqlParameter x = new SqlParameter("@xmlX", SqlDbType.Xml); (i tried Text or Ntext in vain !!)
testclass t = new testclass();

t.Age = 32;
t.FirstName = "Û Ú®Ú…Ù±Ùص؟ Ûž";
t.LastName = "Silver";
t.Locality = "USA";

XMLSerializer<testclass> _serializer = new XMLSerializer<testclass>();
x.Value = _serializer.Serialize(t); (This gives me a UTF-32 XML file)
cmd.Parameters.Add(x);
cmd.ExecuteNonQuery();
I get an error : XML parsing: line 1, character 39, unrecognized encoding.

Evan
 
I manged a workaround. UTF-16 (Unicode) was enough and it is the actual format of XML datatype in SQL2005.
I need to add a UTF32 xml file to an XML datatype (basically I want unicode characters in there)
is it possible?

When I do
SqlParameter x = new SqlParameter("@xmlX", SqlDbType.Xml); (i tried Text or Ntext in vain !!)
testclass t = new testclass();

t.Age = 32;
t.FirstName = "Û Ú®Ú…Ù±Ùص؟ Ûž";
t.LastName = "Silver";
t.Locality = "USA";

XMLSerializer<testclass> _serializer = new XMLSerializer<testclass>();
x.Value = _serializer.Serialize(t); (This gives me a UTF-32 XML file)
cmd.Parameters.Add(x);
cmd.ExecuteNonQuery();
I get an error : XML parsing: line 1, character 39, unrecognized encoding.

Evan
 
Back
Top