Sample code for 30+ languages & platforms
React Native Requires Chilkat v11.1.0+

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat React Native Downloads

React Native
import { Crypt2 } from '@chilkat/react-native'

function chilkatExample() {
  const crypt = new Crypt2();

  let s = '< é ü ç Ω Hello & World ✓ >';

  const htmlEncoded = crypt.encodeString(s, 'utf-8', 'html');
  console.log(htmlEncoded);

  // Output:
  // < &eacute; &uuml; &ccedil; &ohm; Hello & World &check; >

  // To decode:
  s = crypt.decodeString(htmlEncoded, 'utf-8', 'html');
  console.log(s);

  // Output:
  // < é ü ç Ω Hello & World ✓ >
}