Sample code for 30+ languages & platforms
C++

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat C++ Downloads

C++
#include <CkStringBuilder.h>

void ChilkatSample(void)
    {
    //  Decode the following HTML entities, replacing each with the character represented.
    const char *s = "&eacute; &#233; &#xE9; Latin small letter e with acute";

    CkStringBuilder sb;

    sb.Append(s);
    sb.EntityDecode();

    //  Output: é é é Latin small letter e with acute
    std::cout << sb.getAsString() << "\r\n";
    }