HTML Zeichen?

  • Hallo :)
    Ich habe folgendes Problem:
    Ich lade eine Internetseite per InetGet runter. Dabei erscheinen allerdings Zeichen wie z.B. &lt.
    Wie ich kann ich diese Codes wieder in normale Zeichen umwandeln? In PHP habe ich folgendes gefunden: *KLICK*

    Danke schonmal im Vorraus ;)
    Carsten

    • Offizieller Beitrag

    Dein Link ist nicht gültig .

  • Sowas vielleicht:

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ====================================================================================================
    ; Description ...: _ConvertEntities
    ; Parameters ....: $sURL - IN - The Text to convert
    ; Return values .: Success - Converted string
    ; Author ........: Stephen Podhajecki {gehossafats at netmdc. com}
    ; Remarks .......: Replaces HTML escape sequences with character representation
    ; Based on information found here: http://www.theukwebdesigncompany.com/artic...-characters.php
    ; nbsp is changed to 32 instead of 160
    ; Related .......:
    ; ====================================================================================================
    Func _ConvertEntities($sURL)
    Local $sTemp = $sUrl
    Local $aEntities[96][2]=[[""",34],["&",38],["<",60],[">",62],[" ",3],[" ",32] _
    ,["¡",161],["¢",162],["£",163],["¤",164],["¥",165],["¦",166] _
    ,["§",167],["¨",168],["©",169],["ª",170],["¬",172],["­",173] _
    ,["®",174],["¯",175],["°",176],["±",177],["²",178],["³",179] _
    ,["´",180],["µ",181],["¶",182],["·",183],["¸",184],["¹",185] _
    ,["º",186],["»",187],["¼",188],["½",189],["¾",190],["¿",191] _
    ,["À",192],["Á",193],["Ã",195],["Ä",196],["Å",197],["Æ",198] _
    ,["Ç",199],["È",200],["É",201],["Ê",202],["Ì",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],["þ",254]]
    For $x = 0 to Ubound($aEntities)-1
    $sTemp = StringReplace($sTemp,$aEntities[$x][0],Chr($aEntities[$x][1]),0,2)
    Next
    For $x = 32 to 255
    $sTemp = StringReplace($sTemp,"&#"&$x&";",chr($x))
    Next
    Return $sTemp
    EndFunc

    [/autoit]

    [EDIT]
    Korrigiert: In der Funktion war ein Fehler bei StringReplace (not case sensitive)

    Einmal editiert, zuletzt von Stilgar (2. Februar 2009 um 19:30)