Results 1 to 1 of 1
How do you replace utf-8 characters with plain text from the command line?
e.g. I would like do something like the following:
sed 's/á/\\'a/g' $IN $OUT
If anyone knows how ...
- 07-19-2009 #1
Substitution of International Characters
How do you replace utf-8 characters with plain text from the command line?
e.g. I would like do something like the following:
sed 's/á/\\\'a/g' $IN $OUT
If anyone knows how to do this with perl or sed, I would appreciate the advice.
EDIT: Looks like I solved this one with perl:
perl -p0e "s|á|\\\'a|g;s|é|\\\'e|g;s|í|\\\'i|g;s|ó|\\\'o|g;s |ú|\\\'u|g;s|ü|\\\"u|g;s|ç|\\cc|g;s|ñ|\\\~n|g;s|¿| ?\`|g;s|¡|!\`|g"
Gets converts Spanish characters to their LaTeX equivalents. Looks like sed is losing some of my business.


Reply With Quote