Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Accept and submit Unicode form input.
UTF-8 in Forms is easiest to learn by reading the example, changing it, and observing the result.
// Browsers submit form data as UTF-8 when the page is UTF-8.
const res = await fetch('/api/messages', {
method: 'POST',
headers: { 'Content-Type': 'application/json; charset=utf-8' },
body: JSON.stringify({ text: 'Hola 😀 世界' })
});
console.log(await res.json());Practice the UTF-8 in Forms example in a small scratch file, then explain what changed and why.