Solved

strange character on text

Posted on 2011-02-28
7
388 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:saloj
7 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35004611
I guess this is an issue with the font you are using and the (different) font on the end users PC.
0
 
LVL 8

Expert Comment

by:PagodNaUtak
ID: 35004646
Can you show us the xml file? And does the client uses differrent language?
0
 
LVL 10

Expert Comment

by:John Claes
ID: 35004718
Is this not a standard issue of Encoding?
The Encoding of the Xml is different from the encoding of the website.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 35004848
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
 
LVL 17

Expert Comment

by:selvol
ID: 35004855
The rouge charater could be Arabic words being shown in a single byte English font. If you aren't using double byte (Unicode) .?????
0
 
LVL 2

Author Comment

by:saloj
ID: 35004971
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
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
ID: 35006236
try


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

{
sw.WriteLine(xmlParseData);
sw.Close();
}
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question