How do I remove diacritics (accents) from a string in .NET?

Recently, while working with our client from Sweden, we have a task to generate a friendly-url based on their input text a.k.a display name. The problem is how to replace their language by english-base.

For example:

If they input “ÄäÖöÕõÜü”, the expectation will be “AaOoOoUu”

Fortunately, .NET worlds and also stackoverflow save us. Here is the thread from stackoverflow and the  best solution for me

https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net#42068811

I only used the first code which is

encode-non-english-string

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s