J
JezB
Is there anything in the framework which will help translate accented
characters in strings to their standard counterparts?
eg. "Gráda" to "Grada"
characters in strings to their standard counterparts?
eg. "Gráda" to "Grada"
Is there anything in the framework which will help translate accented
characters in strings to their standard counterparts?
eg. "Gráda" to "Grada"
There is a method that seems to work in most cases involving translation
between different encodings, but I cannot guarantee that it works in all
cases.
string s = "áàäãâåéèëêíìïîóòöõôøúùüûýÿ";
byte[] b = Encoding.GetEncoding(1251).GetBytes(s);
string t = Encoding.ASCII.GetString(b);
//t == aaaaaaeeeeiiiioooooouuuuyy
There is nothing like this in the framework, what you can do is use
String.Replace , it will be slower but there are only 5 vocals after all
I'm passing artist/album names stored within mp3 files through Amazon's
web service, to look up album details. Many of the artist names have
accented characters, since I am interested in world/celtic music, but
Amazon's serach criteria seems to be based on normalized unaccented
strings. A real pain to edit all my id3 tags !