I’m working on a random name generator to be used in a game I’m developing, the problem is there are different species with different naming styles, and I would like a single name generator to work with all of them. I have part one of this problem sorted – the name generator uses a series of templates, one set for each species of player/NPC.
The main problem I have is some vowels need to have a randomly selected accent mark. I have searched and searched, but I cannot find a way to randomly select a character and then apply an accent mark to it. So, what are the ways one can compose an accented letter by selecting the letter and then applying an accent mark to it?
Unicode has ‘combining’ characters representing most types of accents. It would be pretty easy to randomly select a combining character from an array of combining characters you create. Then you could just put whatever accents you have on any characters you like.
http://en.wikipedia.org/wiki/Combining_character
Since these are represented by codepoints you can treat them as a character on their own: