all groups > dotnet xml > june 2005 >
You're in the

dotnet xml

group:

Problem XML with (à,è)


Problem XML with (à,è) Peppe
6/24/2005 12:00:00 AM
dotnet xml:
When i export a an XML from a dataset, i have a problem with the accented
characters (es. à;é;ì etc)
I know that XML doesn't use it. I should use a particular encoding?

how can i convert this characters?

Exists a function for convert?


(à,è) Martin Honnen
6/24/2005 12:00:00 AM


[quoted text, click to view]

Can you show us exactly what are you doing to export XML and then
explain exactly where the problems occur, which error messages you get etc?
If you use UTF-8 then whatever characters are you used should not cause
problems, unless the problems are not with .NET but with some other
tools that perhaps does not know how to deal with UTF-8.

The following snippet of C# code outputs the following XML to the console:

DataSet dataSet = new DataSet("ExampleDataSet");
DataTable dataTable = dataSet.Tables.Add("ExampleTable");
dataTable.Columns.Add("Text", typeof(string));
DataRow dataRow = dataTable.NewRow();
dataRow["Text"] = "à,è";
dataTable.Rows.Add(dataRow);
dataSet.WriteXml(Console.Out);

<ExampleDataSet>
<ExampleTable>
<Text>à,è</Text>
</ExampleTable>
</ExampleDataSet>

--

Martin Honnen --- MVP XML
Re: Problem XML with (à,è) Peppe
6/24/2005 12:00:00 AM
I have this code :

DtSetXML.Tables.Add(FieldsDTB)
Parameters(1).Values = DtSetXML.GetXml ----<Parameters of stored
porocedure

I send to a parameters of a stored procedure(SQL) my XML....

How can i convert?

(à,è) Martin Honnen
6/24/2005 12:00:00 AM


[quoted text, click to view]

And what exactly is the problem you get? Is there an error happening
with GetXml? It seems perhaps that the problem is with the parameter,
you would need to ask in a ADO.NET group then, the DataSet just gives
you XML as a string and .NET strings have no problems with accented
characters.

--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button