strange character on text

Hi EE,

we are parsing xml file from client and displaying on websites but some websites are displaying strange character like Â

i tried to replace   character but does not  solve the issue.

what is the character and why it is only affecting some websites.

how to remove it?

Thanks
LVL 2
salojAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Kumaraswamy RConnect With a Mentor Commented:
try


using (StreamWriter sw = New System.IO.StreamWriter(filename, True, System.Text.Encoding.GetEncoding("windows-1252"))

{
sw.WriteLine(xmlParseData);
sw.Close();
}
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
I guess this is an issue with the font you are using and the (different) font on the end users PC.
0
 
PagodNaUtakCommented:
Can you show us the xml file? And does the client uses differrent language?
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
John ClaesSenior .Net Consultant & Technical AnalistCommented:
Is this not a standard issue of Encoding?
The Encoding of the Xml is different from the encoding of the website.
0
 
Kumaraswamy RCommented:
HI
This is  problem with encoding
bellow ur give some information
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23813008.html
0
 
selvolCommented:
The rouge charater could be Arabic words being shown in a single byte English font. If you aren't using double byte (Unicode) .?????
0
 
salojAuthor Commented:
Hi Guys
I guess, it should be issue of encoding. while I am saving my xmlData on UTF-8 format and send the file to many websites and some parse well and some display with that strange character.

here is my code, i use to write xml data on file.

Thanks
strXml = XMLDATA;

System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
byte[] data = encoding.GetBytes(strXml.ToString());
string xmlParseData = encoding.GetString(data);
                
using (StreamWriter sw = new StreamWriter(xSavePath))
{
sw.WriteLine(xmlParseData);
sw.Close();
}

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.