C++
C++
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat C++ Downloads
#include <CkCrypt2.h>
void ChilkatSample(void)
{
CkCrypt2 crypt;
const char *s = "< é ü ç Ω Hello & World ✓ >";
const char *htmlEncoded = crypt.encodeString(s,"utf-8","html");
std::cout << htmlEncoded << "\r\n";
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
s = crypt.decodeString(htmlEncoded,"utf-8","html");
std::cout << s << "\r\n";
// Output:
// < é ü ç Ω Hello & World ✓ >
}