Convert Accented Characters to ASCII

It is pretty simple in .NET to convert Western Unicode (non-ASCII, accented, diacritics) to ASCII, but regardless I had a hard time figuring it out it so I’m posting here for my own future reference.

[code lang=”vb”]
Dim strTest as String = "Any string containing accented characters, e.g. åäöéèêÅÄÖÉÈÊ"
strTest = System.Text.Encoding.ASCII.GetString(System.Text.Encoding.GetEncoding(1251).GetBytes(strTest))
[/code]

3 Replies to “Convert Accented Characters to ASCII”

Leave a Reply

Your email address will not be published. Required fields are marked *