Solved

strange character on text

Posted on 2011-02-28
7
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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