v146 · Web APIs · Charset Demo

Charset Demo

These examples construct Data URLs with and without charset parameters. In Chrome 146, the parameter is preserved and the browser uses the correct encoding when rendering the content. Fetch the URL to see the full content-type in the response.

The most visible effect of parameter preservation is correct rendering of non-ASCII text. A charset=iso-8859-1 Data URL containing accented characters will render correctly in Chrome 146 (where the charset is preserved) vs incorrectly in older versions (where it was stripped and UTF-8 was assumed).

built-in examples

pre-v146: data:text/html (charset stripped)

Chrome 146+: data:text/html;charset=iso-8859-1

custom URL builder

Build a URL above to see results…

see also