Convert Unicode char to closest (most similar) char in ASCII (.net)

Posted by Andrey on Stack Overflow See other posts from Stack Overflow or by Andrey
Published on 2010-04-12T19:07:58Z Indexed on 2010/04/12 19:13 UTC
Read the original article Hit count: 488

Filed under:
|
|
|

Hi all!

Do you have any idea how to covert different Unicode characters to their closest ASCII equivalents? Like Ä -> A. A googled but didn't find any suitable solution. Trick Encoding.ASCII.GetBytes("Ä")[0] didn't work. (Result was ?). I found that there is class Encoder that has Fallback property that is exactly for cases when char can't be converted, but implementations (EncoderReplacementFallback) are stupid and convert to ?.

Any ideas?

Thanks, Andrey

© Stack Overflow or respective owner

Related posts about .NET

Related posts about encoding