Sample code for 30+ languages & platforms
Unicode C

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    const wchar_t *s;
    HCkStringBuilderW sb;

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

    sb = CkStringBuilderW_Create();

    CkStringBuilderW_Append(sb,s);
    CkStringBuilderW_EntityDecode(sb);

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


    CkStringBuilderW_Dispose(sb);

    }