Tuesday, November 21, 2006

Replacing ANSI Portuguese characters by HTML entities

In order to improve the quality of web pages, characters in the upper half of the ANSI table should be replaced by corresponding HTML entities. Otherwise, browsers with different configurations might show incorrect characters.

To automatically replace these characters, I wrote two small bash scripts. The first, html_entities.sh, performs the replacement in na single file and the second, exec_html_entities.sh , recursively replace characters in all files in a given directory and all its subdirectories.


Sherwin said...

The html_entities.sh file needs to have a g at the end of each line so the change is global, meaning it gets every entry on every line instead of just the first entry. A very nice utility. Obrigado!!!

Alfredo Ferreira said...

Thanks for your comment.
This "bug" is now solved.