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.