The AMP spec requires <meta charset="utf-8"> and this is naturally problematic for sites that still use a Latin1 charset. We need to do a few things:
- For existing paired mode theme system, we'll need to use
mb_convert_encoding() from the get_bloginfo('charset') to utf-8 when reading from the DB. We'll also need to forcibly add header( 'Content-Type: text/html; charset=utf-8' ) to override what WordPress is sending by default.
- With canonical AMP, we'll be output buffering the response and so we could convert the encoding at the time of output. We'll still need to be wary of
\AMP_DOM_Utils::get_dom_from_content() in how it is currently assuming UTF-8 content for the input.
https://github.com/Automattic/amp-wp/blob/e60cb152a50e2ffbf5504d41aee859ad1d0e0baa/includes/class-amp-theme-support.php#L192
The AMP spec requires
<meta charset="utf-8">and this is naturally problematic for sites that still use a Latin1 charset. We need to do a few things:mb_convert_encoding()from theget_bloginfo('charset')toutf-8when reading from the DB. We'll also need to forcibly addheader( 'Content-Type: text/html; charset=utf-8' )to override what WordPress is sending by default.\AMP_DOM_Utils::get_dom_from_content()in how it is currently assuming UTF-8 content for the input.https://github.com/Automattic/amp-wp/blob/e60cb152a50e2ffbf5504d41aee859ad1d0e0baa/includes/class-amp-theme-support.php#L192