views:

148

answers:

1

How can you make this \"{a} to present a with dots in Doxygen?

My files are full of the character \"{a}. It should be universal encoding for a with dots. However, it is clearly not the case. My encoding is UTF-8 at the moment. The symbol works with the encoding in Vim.

+1  A: 

Unless you have a compelling reason for using that particular escape for a-with-an-umlaut, I suggest that you simply replace all occurrences with the actual character "ä" (Unicode code point U+00E4).

Michael Petrotta
**How can you make this replacement safely?** It seems to be a task for `tr`. I am not sure how to do it.
Masi
You're in the Unix world, and I can't help you there. I assume that there are plenty of global find-and-replace tools available to you; I'd simply replace the literal (not regex) *\"{a}* with *ä* in any files that could contain that escape. Review a sampling of the results. I don't know LaTeX, and I could see that there could be a risk there - the LaTeX world might have a solution.
Michael Petrotta
If you're using vim, you should be able to do something like `:%s/\\"{a}/ä/g`. There aren't any wildcards here so it's a pretty safe search and replace, but if you want to do a little testing, you can use `:%s/\\"{a}/ä/gc`, which will let you say yes or no to each substitution.
Jefromi
Oh, and if you need to do this in multiple files, have a look at the `bufdo` and `windo` commands, which can apply a command to all open buffers or windows. If you want to do this from command-line/script, try `sed` (not `tr`, which works only on single characters). Something like `sed 's/\\"{a}/ä/g' <files>` should work, and then you can add the `-i` option once you know it's doing the right thing to have it edit the files in place.
Jefromi
Perl is finally the rigth tool. This solves the problem `perl -i.bak -pe 's@hello@@'`
Masi