Wintertree Software Inc.

Wintertree Spelling Server

Home Site index Contact us Catalog Shopping Cart Products Support Search

You are here: Home > Support > Wintertree Spelling Server > Characters with diacritical marks converted to HTML character entities


Characters with diacritical marks converted to HTML character entities

Applies to: Version 1.6 and earlier

Symptom: When I check spelling in non-English languages, characters with diacritical marks (e.g., ø) are converted to HTML character entity references (e.g., ø).

This behavior is by design, although it was removed in version 1.7. It occurs when the WSS_IGNORE_HTML_MARKUPS_OPT option is enabled. When this option is enabled, the text being checked is assumed to contain valid HTML, and any changes made to the text must not corrupt the validity of the HTML. Any non-ASCII characters (such as characters with diacritical marks) are converted to HTML character entity references, such as "ø" so that if the suggested word is used to replace a misspelled word, the text will still contain valid HTML.

Because Wintertree Spelling Server's user interface is implemented in VBScript or VB code, it is possible to modify the behavior by modifying the code. Look for places where the Suggest method is called (for example, if you're using ASP Example 6, the Suggest method is called near line 73 in AppletServer.asp). You can convert any character entity references back to characters inserting the following code after the call to the Suggest method:

suggestions = Replace(suggestions, "À", "À")
suggestions = Replace(suggestions, "Á", "Á")
suggestions = Replace(suggestions, "Â", "Â")
suggestions = Replace(suggestions, "Ã", "Ã")
suggestions = Replace(suggestions, "Ä", "Ä")
suggestions = Replace(suggestions, "Å", "Å")
suggestions = Replace(suggestions, "Æ", "Æ")
suggestions = Replace(suggestions, "Ç", "Ç")
suggestions = Replace(suggestions, "È", "È")
suggestions = Replace(suggestions, "É", "É")
suggestions = Replace(suggestions, "Ê", "Ê")
suggestions = Replace(suggestions, "Ë", "Ë")
suggestions = Replace(suggestions, "Ì", "Ì")
suggestions = Replace(suggestions, "Í", "Í")
suggestions = Replace(suggestions, "Î", "Î")
suggestions = Replace(suggestions, "Ï", "Ï")
suggestions = Replace(suggestions, "Ð", "Ð")
suggestions = Replace(suggestions, "Ñ", "Ñ")
suggestions = Replace(suggestions, "Ò", "Ò")
suggestions = Replace(suggestions, "Ó", "Ó")
suggestions = Replace(suggestions, "Ô", "Ô")
suggestions = Replace(suggestions, "Õ", "Õ")
suggestions = Replace(suggestions, "Ö", "Ö")
suggestions = Replace(suggestions, "Ø", "Ø")
suggestions = Replace(suggestions, "Ù", "Ù")
suggestions = Replace(suggestions, "Ú", "Ú")
suggestions = Replace(suggestions, "Û", "Û")
suggestions = Replace(suggestions, "Ü", "Ü")
suggestions = Replace(suggestions, "Ý", "Ý")
suggestions = Replace(suggestions, "Þ", "Þ")
suggestions = Replace(suggestions, "ß", "ß")
suggestions = Replace(suggestions, "à", "à")
suggestions = Replace(suggestions, "á", "á")
suggestions = Replace(suggestions, "â", "â")
suggestions = Replace(suggestions, "ã", "ã")
suggestions = Replace(suggestions, "ä", "ä")
suggestions = Replace(suggestions, "å", "å")
suggestions = Replace(suggestions, "æ", "æ")
suggestions = Replace(suggestions, "ç", "ç")
suggestions = Replace(suggestions, "è", "è")
suggestions = Replace(suggestions, "é", "é")
suggestions = Replace(suggestions, "ê", "ê")
suggestions = Replace(suggestions, "ë", "ë")
suggestions = Replace(suggestions, "ì", "ì")
suggestions = Replace(suggestions, "í", "í")
suggestions = Replace(suggestions, "î", "î")
suggestions = Replace(suggestions, "ï", "ï")
suggestions = Replace(suggestions, "ð", "ð")
suggestions = Replace(suggestions, "ñ", "ñ")
suggestions = Replace(suggestions, "ò", "ò")
suggestions = Replace(suggestions, "ó", "ó"
suggestions = Replace(suggestions, "ô", "ô")
suggestions = Replace(suggestions, "õ", "õ")
suggestions = Replace(suggestions, "ö", "ö")
suggestions = Replace(suggestions, "ø", "ø")
suggestions = Replace(suggestions, "ù", "ù")
suggestions = Replace(suggestions, "ú", "ú")
suggestions = Replace(suggestions, "û", "û")
suggestions = Replace(suggestions, "ü", "ü")
suggestions = Replace(suggestions, "ý", "ý")
suggestions = Replace(suggestions, "þ", "þ")
suggestions = Replace(suggestions, "ÿ", "ÿ")

The code above replaces HTML character entity references (e.g., ø) with non-ASCII charcters (e.g., ø) in the "suggestions" variable. The same code will work in other places in Wintertree Spelling Server, although be sure to check the name of the variable which receives the suggestion list from the Suggest method, and substitute that variable's name for "suggestions" in the code above.


Home Site index Contact us Catalog Shopping Cart Products Support Search


Copyright © 2015 Wintertree Software Inc.