Click here to Skip to main content
15,902,189 members
Home / Discussions / C#
   

C#

 
Questionabstract classes Pin
Pankaj Garg16-May-08 2:10
Pankaj Garg16-May-08 2:10 
AnswerRe: abstract classes Pin
Christian Graus16-May-08 2:11
protectorChristian Graus16-May-08 2:11 
QuestionRe: abstract classes Pin
Pankaj Garg16-May-08 2:23
Pankaj Garg16-May-08 2:23 
AnswerRe: abstract classes Pin
Christian Graus16-May-08 2:28
protectorChristian Graus16-May-08 2:28 
AnswerRe: abstract classes Pin
Christian Wikander16-May-08 2:19
Christian Wikander16-May-08 2:19 
AnswerRe: abstract classes Pin
J4amieC16-May-08 2:29
J4amieC16-May-08 2:29 
AnswerRe: abstract classes Pin
Jörgen Sigvardsson16-May-08 2:37
Jörgen Sigvardsson16-May-08 2:37 
GeneralRe: abstract classes Pin
PIEBALDconsult16-May-08 5:44
mvePIEBALDconsult16-May-08 5:44 
AnswerRe: abstract classes Pin
Guffa16-May-08 3:09
Guffa16-May-08 3:09 
AnswerOOP tutorial needed. Pin
CPallini16-May-08 3:56
mveCPallini16-May-08 3:56 
AnswerRe: abstract classes Pin
PIEBALDconsult16-May-08 5:48
mvePIEBALDconsult16-May-08 5:48 
AnswerRe: abstract classes Pin
Hamid_RT17-May-08 7:22
Hamid_RT17-May-08 7:22 
Questionnotification Pin
ellllllllie16-May-08 1:38
ellllllllie16-May-08 1:38 
AnswerRe: notification Pin
originSH16-May-08 1:39
originSH16-May-08 1:39 
AnswerRe: notification Pin
Pete O'Hanlon16-May-08 2:06
mvePete O'Hanlon16-May-08 2:06 
Questionproblems in checklistbox Pin
Amitava Dutta16-May-08 1:05
Amitava Dutta16-May-08 1:05 
AnswerRe: problems in checklistbox Pin
Christian Wikander16-May-08 2:25
Christian Wikander16-May-08 2:25 
QuestionHow can i read print content (print document data) from a Job using PrintQueueStream [modified] Pin
Krishna Prasad RVS16-May-08 0:38
Krishna Prasad RVS16-May-08 0:38 
QuestionXML encoding issue Pin
George_George16-May-08 0:11
George_George16-May-08 0:11 
AnswerRe: XML encoding issue Pin
mlsteeves16-May-08 3:48
mlsteeves16-May-08 3:48 
Looking at msdn documenation: http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.createxmldeclaration.aspx[^]

The section about encoding says,

"The value of the encoding attribute. This is the encoding that is used when you save the XmlDocument to a file or a stream; therefore, it must be set to a string supported by the Encoding class, otherwise Save fails. If this is nullNothingnullptra null reference (Nothing in Visual Basic) or String.Empty, the Save method does not write an encoding attribute on the XML declaration and therefore the default encoding, UTF-8, is used.

Note: If the XmlDocument is saved to either a TextWriter or an XmlTextWriter, this encoding value is discarded. Instead, the encoding of the TextWriter or the XmlTextWriter is used. This ensures that the XML written out can be read back using the correct encoding. "


So I would guess that the "note" applies in your case. Your StringWriter that you are saving to is causing the encoding value to be ignored. (I imagine that the underlying StringBuilder is using UTF-16 strings)

If you were to use the XmlTextWriter, then you can specify the encoding that you want.
GeneralRe: XML encoding issue Pin
George_George16-May-08 4:49
George_George16-May-08 4:49 
GeneralRe: XML encoding issue Pin
mlsteeves16-May-08 5:22
mlsteeves16-May-08 5:22 
GeneralRe: XML encoding issue Pin
George_George16-May-08 20:37
George_George16-May-08 20:37 
GeneralRe: XML encoding issue Pin
mlsteeves20-May-08 1:55
mlsteeves20-May-08 1:55 
GeneralRe: XML encoding issue Pin
George_George20-May-08 3:55
George_George20-May-08 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.