Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to convert á character to a and so on using c#

Posted on 2009-02-18
3
Medium Priority
?
451 Views
Last Modified: 2013-11-07
I am using the streamreader to open the file like below

StreamReader re = new StreamReader(sFilename, System.Text.Encoding.Default);
and my text file contains the characters like á
I am able to read them when i use stream reader.
But,I want those characters to be replaced like

á--a
etc

Thanks in advance
0
Comment
Question by:narlasridhar
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
abel earned 1000 total points
ID: 23669257
Unfortunately, this is not a trivial task. A broad description of the problem and the solution can be found here: http://www.codeproject.com/KB/cs/UnicodeNormalization.aspx, including sample code you can download. The page shows two approaches, but the first is by far the easiest and suits most needs.

A third approach would be to use XSLT2/XPath2 functions, as they support normalization (the name for this task) out of the box. It is a bit of overkill, but you can take the Saxon.Net libraries (10MB!) and use an XPath expression on your string to normalize them. If you want to go that path I can help you setting it up (I've been there before).
0
 

Author Closing Comment

by:narlasridhar
ID: 31548201
Thanks for your immediate response.
0
 
LVL 39

Expert Comment

by:abel
ID: 23669637
You're welcome ;)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

571 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