Unicode C++
Unicode C++
HTML Entity Encode and Decode in StringBuilder
Demonstrates HTML encoding and decoding the contents of a StringBuilder.Chilkat Unicode C++ Downloads
#include <CkStringBuilderW.h>
void ChilkatSample(void)
{
CkStringBuilderW sb;
const wchar_t *s = L"< é ü ç Ω Hello & World ✓ >";
sb.Append(s);
sb.Encode(L"html",L"utf-8");
wprintf(L"%s\n",sb.getAsString());
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
sb.Decode(L"html",L"utf-8");
wprintf(L"%s\n",sb.getAsString());
// Output:
// < é ü ç Ω Hello & World ✓ >
}