Accueil





Convertir des entités HTML



Variable à déclarer
variable entities { "&agrave;" "à" "&agrave;" "à" "&aacute;" "á" "&acirc;" "â" "&atilde;" "ã" "&auml;" "ä" "&aring;" "å" "&aelig;" "æ" "&ccedil;" "ç" "&egrave;" "è" "&eacute;" "é" "&ecirc;" "ê" "&euml;" "ë" "&igrave;" "ì" "&iacute;" "í" "&icirc;" "î" "&iuml;" "ï" "&eth;" "ð" "&ntilde;" "ñ" "&ograve;" "ò" "&oacute;" "ó" "&ocirc;" "ô" "&otilde;" "õ" "&ouml;" "ö" "&divide;" "÷" "&oslash;" "ø" "&ugrave;" "ù" "&uacute;" "ú" "&ucirc;" "û" "&uuml;" "ü" "&yacute;" "ý" "&thorn;" "þ" "&yuml;" "ÿ" "&quot;" "\"" "&amp;" "&" "&euro;" "€" "&oelig;" "œ" "&Yuml;" "Ÿ" "&nbsp;" " " "&iexcl;" "¡" "&cent;" "¢" "&pound;" "£" "&curren;" "¤" "&yen;" "¥" "&brvbar;" "¦" "&brkbar;" "¦" "&sect;" "§" "&uml;" "¨" "&die;" "¨" "&copy;" "©" "&ordf;" "ª" "&laquo;" "«" "&not;" "¬" "&shy;" "­-" "&reg;" "®" "&macr;" "¯" "&hibar;" "¯" "&deg;" "°" "&plusmn;" "±" "&sup2;" "²" "&sup3;" "³" "&acute;" "´" "&micro;" "µ" "&para;" "¶" "&middot;" "·" "&cedil;" "¸" "&sup1;" "¹" "&ordm;" "º" "&raquo;" "»" "&frac14;" "¼" "&frac12;" "½" "&frac34;" "¾" "&iquest;" "¿" "&Agrave;" "À" "&Aacute;" "Á" "&Acirc;" "Â" "&Atilde;" "Ã" "&Auml;" "Ä" "&Aring;" "Å" "&AElig;" "Æ" "&Ccedil;" "Ç" "&Egrave;" "È" "&Eacute;" "É" "&Ecirc;" "Ê" "&Euml;" "Ë" "&Igrave;" "Ì" "&Iacute;" "Í" "&Icirc;" "Î" "&Iuml;" "Ï" "&ETH;" "Ð" "&Dstrok;" "Ð" "&Ntilde;" "Ñ" "&Ograve;" "Ò" "&Oacute;" "Ó" "&Ocirc;" "Ô" "&Otilde;" "Õ" "&Ouml;" "Ö" "&times;" "×" "&Oslash;" "Ø" "&Ugrave;" "Ù" "&Uacute;" "Ú" "&Ucirc;" "Û" "&Uuml;" "Ü" "&Yacute;" "Ý" "&THORN;" "Þ" "&szlig;" "ß" "\r" "\n" "\t" "" "&apos;" "\'" "&#039;" "\'" "&#39;" "\'" "&#92" "\\" "&#34;" "\"" "&#38;" "&" "&#091;" "\[" "&#047;" "/" "&lt;" "<" "&gt;" ">" "&#093;" "\]" "&#47;" "/" "&#040;" "\(" "&#041;" "\)" "&#163;" "£" "&#33;" "!" "&#168;" "¨" "&#169;" "©" "&#171;" "«" "&#173;" "­" "&#174;" "®" "&#180;" "´" "&#183;" "·" "&#185;" "¹" "&#187;" "»" "&#188;" "¼" "&#189;" "½" "&#190;" "¾" "&#192;" "À" "&#193;" "Á" "&#194;" "Â" "&#195;" "Ã" "&#196;" "Ä" "&#197;" "Å" "&#198;" "Æ" "&#199;" "Ç" "&#200;" "È" "&#201;" "É" "&#202;" "Ê" "&#203;" "Ë" "&#204;" "Ì" "&#205;" "Í" "&#206;" "Î" "&#207;" "Ï" "&#208;" "Ð" "&#209;" "Ñ" "&#210;" "Ò" "&#211;" "Ó" "&#212;" "Ô" "&#213;" "Õ" "&#214;" "Ö" "&#215;" "×" "&#216;" "Ø" "&#217;" "Ù" "&#218;" "Ú" "&#219;" "Û" "&#220;" "Ü" "&#221;" "Ý" "&#222;" "Þ" "&#223;" "ß" "&#224;" "à" "&#225;" "á" "&#226;" "â" "&#227;" "ã" "&#228;" "ä" "&#229;" "å" "&#230;" "æ" "&#231;" "ç" "&#232;" "è" "&#233;" "é" "&#234;" "ê" "&#235;" "ë" "&#236;" "ì" "&#237;" "í" "&#238;" "î" "&#239;" "ï" "&#240;" "ð" "&#241;" "ñ" "&#242;" "ò" "&#243;" "ó" "&#244;" "ô" "&#245;" "õ" "&#246;" "ö" "&#247;" "÷" "&#248;" "ø" "&#249;" "ù" "&#250;" "ú" "&#251;" "û" "&#252;" "ü" "&#253;" "ý" "&#254;" "þ" }


Procédure
proc html_entities_decode {data} { variable entities return [::tcl::string::map $entities $data] } proc html_entities_encode {data} { variable entities return [::tcl::string::map [lreverse $entities] $data] }


La procédure suivante convertira automatiquement toutes les entités html décimales ou hexadécimales ( formats &#?? ou &#x??; ).
proc html_hexdec_decode {data} { regsub -all {&#([[:digit:]]{1,5});} $data {[format %c [string trimleft "\1" "0"]]} data regsub -all {&#x([[:xdigit:]]{1,4});} $data {[format %c [scan "\1" %x]]} data return [subst $data] }

©2005-2016 Menz Agitat