Don't waste your time reviewing my code, please consider the goal only: 1. to replace any diacritical mark into any Unicode character with any other Unicode diacritical mark and 2. to add any Unicode diacritical mark to any Unicode character (with or without pre-existing diacritical marks) with
one click only.
To lower editing time is the very first goal that a busy wikisource user would like, IMHO. So, I'll save my poor tool since I feel it very useful ; presently the tool is being used into a very complex and ancient glottology text covering Italian ladin dialects; I presume, it will be useful too dealing with difficult Latin and polyphonic Greek too.
Alex