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

Posted on 2009-02-18
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


Thanks in advance
Question by:narlasridhar
    LVL 39

    Accepted Solution

    Unfortunately, this is not a trivial task. A broad description of the problem and the solution can be found here:, 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).

    Author Closing Comment

    Thanks for your immediate response.
    LVL 39

    Expert Comment

    You're welcome ;)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    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.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now