 ::::::Sorry I though it was clear enough.  Interesting script, it seems that we both have taken two different ways of dealing with the problem, your converting character by character while I'm converting the valid values into a percent encoded string then converting it.  It also seems that we've encountered different edge cases.  Here's the combined list of what we should avoid, HTML tags, character entities (&…;), wikicode which is parsed into HTML, %XX (or .25XX) since the software screws that up.  —  