/** @jsxRuntime classic */ /** @jsx h */ /* sample-utf8.jsx: non-ASCII text in JSX, saved with a UTF-8 byte order mark (BOM) and Windows (CRLF) line endings. Free sample from 99helpers.com/file-types/jsx Run: npx tsx sample-utf8.jsx or bun sample-utf8.jsx Every tool should print the same twelve lines. Garbled letters (é instead of é) mean a step read the file as something other than UTF-8. */ // A tiny JSX factory that returns HTML strings, so no React is needed. const h = (tag, props, ...children) => `<${tag}${Object.entries(props ?? {}).map(([k, v]) => ` ${k}="${v}"`).join("")}>${children.flat().join("")}${tag}>`; const lines = [
English: café, naïve, résumé
,Nederlands: één, coördinatie, Curaçao
,Deutsch: Größe, Straße, Übung
,Polski: zażółć gęślą jaźń
,Ελληνικά: Καλημέρα κόσμε
,Русский: Привет, мир
,العربية: مرحبا بالعالم
,עברית: שלום עולם
,中文: 你好,世界
,日本語: こんにちは世界
, // JSX text understands HTML entities; JavaScript strings do not.Entities: € 12 © ← → ♥
,Emoji: 👋 🌍 ✅ ☕
, ]; for (const line of lines) console.log(line);