Click here to Skip to main content
15,907,326 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get control reference from handle? Pin
leppie9-Jan-03 20:51
leppie9-Jan-03 20:51 
GeneralStatic TextBoxt that keeps disappearing Pin
laphijia9-Jan-03 13:43
laphijia9-Jan-03 13:43 
GeneralRe: Static TextBoxt that keeps disappearing Pin
FruitBatInShades9-Jan-03 14:07
FruitBatInShades9-Jan-03 14:07 
GeneralRe: Static TextBoxt that keeps disappearing Pin
laphijia9-Jan-03 21:33
laphijia9-Jan-03 21:33 
Generalweird MSCORLIB Exception Pin
matthias s.9-Jan-03 11:36
matthias s.9-Jan-03 11:36 
GeneralRe: weird MSCORLIB Exception Pin
leppie9-Jan-03 12:13
leppie9-Jan-03 12:13 
GeneralRe: weird MSCORLIB Exception Pin
matthias s.10-Jan-03 6:33
matthias s.10-Jan-03 6:33 
GeneralRe: weird MSCORLIB Exception Pin
leppie10-Jan-03 6:55
leppie10-Jan-03 6:55 
GeneralRe: weird MSCORLIB Exception Pin
matthias s.10-Jan-03 7:32
matthias s.10-Jan-03 7:32 
GeneralRe: weird MSCORLIB Exception - Solution Pin
matthias s.10-Jan-03 7:47
matthias s.10-Jan-03 7:47 
GeneralRe: weird MSCORLIB Exception Pin
James T. Johnson10-Jan-03 18:31
James T. Johnson10-Jan-03 18:31 
GeneralRe: weird MSCORLIB Exception Pin
leppie11-Jan-03 0:23
leppie11-Jan-03 0:23 
Question'Subclassing' child controls. Is it possible? Pin
FruitBatInShades9-Jan-03 10:45
FruitBatInShades9-Jan-03 10:45 
AnswerRe: 'Subclassing' child controls. Is it possible? Pin
leppie9-Jan-03 11:00
leppie9-Jan-03 11:00 
GeneralRe: 'Subclassing' child controls. Is it possible? Pin
FruitBatInShades9-Jan-03 11:10
FruitBatInShades9-Jan-03 11:10 
GeneralRe: 'Subclassing' child controls. Is it possible? Pin
David Stone11-Jan-03 5:16
sitebuilderDavid Stone11-Jan-03 5:16 
GeneralQuestion on xml encoding in C# Pin
Bugoy9-Jan-03 10:29
Bugoy9-Jan-03 10:29 
GeneralRe: Question on xml encoding in C# Pin
leppie9-Jan-03 10:46
leppie9-Jan-03 10:46 
GeneralRe: Question on xml encoding in C# Pin
Bugoy9-Jan-03 11:49
Bugoy9-Jan-03 11:49 
GeneralRe: Question on xml encoding in C# Pin
leppie9-Jan-03 12:05
leppie9-Jan-03 12:05 
GeneralRe: Question on xml encoding in C# Pin
leppie9-Jan-03 20:49
leppie9-Jan-03 20:49 
GeneralRe: Question on xml encoding in C# Pin
Bugoy10-Jan-03 8:27
Bugoy10-Jan-03 8:27 
GeneralRe: Question on xml encoding in C# Pin
Stephane Rodriguez.10-Jan-03 22:51
Stephane Rodriguez.10-Jan-03 22:51 
First of all, there is nothing wrong in getting an UTF-16 encoding (aka Unicode) since you are explicitely outputting a string content whose encoding is, by design, stored as Unicode (all string content in .NET is stored as unicode, like Java by the way).

Next to that, you have a System.Xml.TextWriter(string filename, Encoding enc) constructor ready to help you. Why don't you use it ? UTF-8 is the default encoding if you don't provide one. Then simply use your string content through WriteRaw(string) calls.

Just in case you don't want to tweak your current code, you can achieve what you need (again, that's bad use of the classes) by deriving the Xml.XmlTextWriter class and provide this constructor :

public XmlTextWriter_(TextWriter w, Encoding enc) {
  this = new XmlTextWriter_();
  this.textWriter = w;
  this.encoding = enc;
  this.xmlEncoder = new XmlTextEncoder(w, this.encoding);
  this.xmlEncoder.QuoteChar = this.quoteChar;
}



PS : train[^] yourself with these free training courses.
GeneralRe: Question on xml encoding in C# Pin
leppie10-Jan-03 23:12
leppie10-Jan-03 23:12 
GeneralRe: Question on xml encoding in C# Pin
Stephane Rodriguez.10-Jan-03 23:42
Stephane Rodriguez.10-Jan-03 23:42 

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.