How is charset supposed to be handled in imported HTML files?

97 views
Skip to first unread message

Jan Miksovsky

unread,
Feb 11, 2014, 7:44:00 PM2/11/14
to polym...@googlegroups.com
To what extent do individual imported HTML files need to specify a charset (e.g., <meta charset="utf-8")?

I have an app that imports a separate .html file defining a Polymer element, and the imported file includes a Unicode glyph. The main HTML file defines a charset, but the included HTML file does not. I'm pretty sure this used to work fine, but now I see the element's glyph rendered as garbage characters. This happens under both current Canary and current production Chrome.

Including an explicit meta charset element in the included element file fixes the problem, so I can work around the problem. But I'm wondering if there'd been some larger philosophical shift or statement made about charsets in imported HTML files. Are elements supposed to implicitly pick up the charset of the importing page, or should every HTML file — including those for elements — always specify a charset?

If this is a bug, I'm happy to file one. (I'd only held back because I can't do this as a simple jsbin.)

Daniel Freedman

unread,
Feb 11, 2014, 7:48:58 PM2/11/14
to Jan Miksovsky, polymer-dev
According to the spec, Imports are supposed to default to UTF-8: https://www.w3.org/Bugs/Public/show_bug.cgi?id=21275

Currently the native implementation in Chrome does not force UTF-8: https://code.google.com/p/chromium/issues/detail?id=336698


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/8cb9e840-7e71-4c10-8826-f16dcafe28a1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jan Miksovsky

unread,
Feb 11, 2014, 7:58:26 PM2/11/14
to polym...@googlegroups.com, Jan Miksovsky
Daniel: Thanks. Should I file a bug for the polyfill, or is that a known problem?

Daniel Freedman

unread,
Feb 11, 2014, 8:10:11 PM2/11/14
to Jan Miksovsky, polymer-dev
Feel free to file a bug for the polyfill. It will help keep us honest :)


Jan Miksovsky

unread,
Feb 11, 2014, 11:23:11 PM2/11/14
to polym...@googlegroups.com, Jan Miksovsky

Scott Miles

unread,
Feb 11, 2014, 11:33:58 PM2/11/14
to Jan Miksovsky, polymer-dev
Reply all
Reply to author
Forward
0 new messages