svsingh has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on one now that reads a text file and creates an HTML file. The text file contains some accented letters (i.e. é). My first instinct is to use a substitution to replace the accented characters with the proper HTML equivalents (i.e. é), but the text file is about 200 kb and there are eight accents that I know of. Running every character (by line) through that many substitutions seems to be a lot more overhead than I want for a dynamic page.
I'm trying to find a method that can do this for me under the assumption that built-in methods are faster. It would also be nice to have a solution that doesn't require me adding another substitution everytime a new accent shows up in the text file. I tried Perl Monks, the Black Book, the Cookbook, and a few web sites. No luck yet.
Am I missing something, or do I have to build this from scratch? If so, then is there a smarter way than individual substitutions?
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Looking for a Better Way to Substitute Characters (accents to HTML)
by glivings (Scribe) on May 10, 2003 at 15:04 UTC | |
|
Re: Looking for a Better Way to Substitute Characters (accents to HTML)
by bobn (Chaplain) on May 10, 2003 at 16:26 UTC | |
|
Re: Looking for a Better Way to Substitute Characters (accents to HTML)
by zentara (Cardinal) on May 11, 2003 at 14:08 UTC |