I have an Excel Macro that seems to work to replace some diacritic chars in a spreadsheet with the closest English equivalents.
I need to add more to the list of diacritics to search for.
I don't need an "authoritative/full" list (and the replacement chars), ideally just those commonly used in major European usage (umlauts, accents etc.)
I was hoping a programmer here would have a list of diacritics (or better, the VBA code, like mine, using them) that they commonly use in a programming language to give a better solution than in the code below.
Sub Replace_Diacritics()
With Cells
.Replace What:="á", Replacement:="a", MatchCase:=False
.Replace What:="é", Replacement:="e", MatchCase:=False
.Replace What:="í", Replacement:="i", MatchCase:=False
.Replace What:="ó", Replacement:="o", MatchCase:=False
.Replace What:="ú", Replacement:="u", MatchCase:=False
End With
End Sub
The range of char codes 192..609 contains 221 char that are representable in ASCII (i. e. can be converted from diacritic chars):
You can try the below simplest function, but it's drawback is that all Unicode chars, which are not representable in ASCII will be replaced with
?
:Other one more complex function replaces only the chars, which are representable in ASCII, the rest chars are unchanged: