ascii_to_HTMLSyntaxeascii_to_HTML(the_text) Convertit un texte du format ASCII au format HTML. Le paramètre et le résultat sont au format texte.
Exempleascii_to_HTML("Père-Noël") ---> "Père-Noël" Scripton ascii_to_HTML(the_text) set HTML_string to "" set ascii_string to " ààââääèèééêêëëççùôôîîïïææ©®£&§<>±÷¬°¡¿ø«»¬ " set HTML_list to {"nbsp", "agrave", "Agrave", "acirc", "Acirc", "auml", "Auml", "egrave", "Egrave", "eacute", "Eacute", "ecirc", "Ecirc", ¬ "euml", "Euml", "ccedil", "Ccedil", "ugrave", "ocirc", "Ocirc", "icirc", "Icirc", "iuml", "Iuml", "aelig", "AElig", ¬ "copy", "reg", "pound", "amp", "sect", "lt", "gt", "plusmn", "divide", "not", "deg", "iexcl", "iquest", "oslash", ¬ "laquo", "raquo", "euro"} repeat with the_char from 1 to count of the_text if character the_char of the_text is return then set HTML_string to HTML_string & "<BR>" else if character the_char of the_text is in ascii_string then set HTML_string to HTML_string & ("&" & item ((offset of (character the_char of the_text) in ascii_string)) of HTML_list & ";") else set HTML_string to HTML_string & (character the_char of the_text) end if end repeat return HTML_string end ascii_to_HTML
RemarqueCette routine a permis l'édition des pages de ce site importées à partir d'une pile HyperCard.
|