Diacritics get stripped out of my capitalization function
I have a very simple capitalization program that helps me auto-capitalize text files. It operates from a capitalization dictionary which is also a text file. The capitalization dictionary consists of nothing more than words that are always capitalized a certain way, separated by line breaks. So, for example, if the capitalization dictionary consists of the following:
"Napoleon Dynamite"
French
iPad
I
and the string to be processed is:
i watched "napoleon dynamite" in french on my ipad
the output after processing will be:
I watched "Napoleon Dynamite" in French on my iPad
However, for some reason I cannot figure out, the program strips out (i.e., deletes) any character that has a diacritic. So if I add to my capitalization dictionary the word:
Napoléon
and the string is:
i watched "napoleon dynamite" in french on my ipad with my friend napoléon
what I end up with is:
I watched "Napoleon Dynamite" in French on my iPad with my friend napolon
Obviously, this is not desired. Can anyone help me figure out what the fix might be, to make sure that letters with diacritics are treated properly rather than being deleted? I think it might have something to do with the ToLower function...
Bookmarks