473,382 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

.NET C# Serializer Problem

When I serialize to a memory object specifying UTF-8 encoding, the result contains 3 leading garbage characters - code: 239 , 187, & 191. If I specify ASCII encoding, the serialization is correct. The code used is:

XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
xs.Serialize( xmlTextWriter, "a String");

What are the 3 leading characters ?? A Bug or just something I don't know about UTF-8 Encoding ?
Aug 17 '07 #1
1 1343
kenobewan
4,871 Expert 4TB
Welcome to TSDN. I believe that the answer to your question lies in the difference between UTF-8 & ascii. HTH.
Aug 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: LEI Zhangyun | last post by:
hi, I'm a new c++ programmer, I want to find a parser which has c++ sax-event typed serializer. In java, there is not ant problem, we can use the package org.apache.xml.serialize. But, in c++,...
0
by: Andy | last post by:
I was quite happily coding away when all of a sudden I started to get the following message: - An exception occurred while trying to create an instance of SearchApp1.ViewsDisplay. The exception...
0
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
1
by: James | last post by:
Hi, I have an array of structures I would like to turn into an XML string using the XML serializer. The problem I am running into is that I get an exception. Depending on what data type I set...
3
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
0
by: Albert Jan | last post by:
Hi, I use the XmlSerializer in C# to serialize an object containing an email message to xml. This works often fine, but for some mailmessages the serialization fails with the message 'There was...
6
by: Dave Veeneman | last post by:
Is XML Serialization worth using to persist classes to file? I've been trying for a day to get it to work on some fairly simple classes. what I'm getting back are error messages like "There is an...
6
by: Wilfried Mestdagh | last post by:
Hi, I use this class to save application settings in a xml file. Sometime I have exception error in the Load method, and sometime in the Save method. Is this a bug in NET or is there something I...
8
by: Q. John Chen | last post by:
I have following code: public class Member { public string FirstName; public string LastName; public string GetXml() { StringBuilder sb = new StringBuilder(); XmlSerializer serializer
1
by: hawkeye.parker | last post by:
using .net 1.1 i think i might want to replace the xml serializer which my .Net webservice uses with a custom serializer. anyone know: a) is this possible? b) if so, is it terribly difficult...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.