Has anyone had to deal with converting extended Latin characters to ASCII?

I need to generate email addresses for users, but cannot use any extended
Latin chars in the email addresses.

So, for example, I need to take an n with a tilde on it and make it just an

Does anyone have any ECMA Script or Java program that could do this? Or
some other way/idea to do that?