Sample code for 30+ languages & platforms
C

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat C Downloads

C
#include <C_CkStringBuilder.h>

void ChilkatSample(void)
    {
    const char *s;
    HCkStringBuilder sb;

    //  Decode the following HTML entities, replacing each with the character represented.
    s = "&eacute; &#233; &#xE9; Latin small letter e with acute";

    sb = CkStringBuilder_Create();

    CkStringBuilder_Append(sb,s);
    CkStringBuilder_EntityDecode(sb);

    //  Output: é é é Latin small letter e with acute
    printf("%s\n",CkStringBuilder_getAsString(sb));


    CkStringBuilder_Dispose(sb);

    }