Perhaps because the entity is a non-UTF8 character?
Here’s what esc_html() does:
function esc_html( $text ) {
$safe_text = wp_check_invalid_utf8( $text );
$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
return apply_filters( 'esc_html', $safe_text, $text );
}
If not that, then it’s getting sanitized when filtered by _wp_specialchars(), which does double-encoding(by default,no) and all sorts of things.
For reference:
1) esc_html() in source
2) _wp_specialchars() in source
Related Posts:
- Should HTML output be passed through esc_html() AND wp_kses()?
- What characters do I need to escape in XML documents?
- What characters must be escaped in HTML 5?
- How can I selectively escape percent (%) in Python strings?
- How do I escape a single quote in jQuery?
- Escape Character in SQL Server
- How to escape apostrophe (‘) in MySql?
- How to prevent escaping when saving HTML code in an option value?
- Escaping and sanitizing SVGs in metabox textarea
- Sanitize and data validation with apply_filters() function
- What’s the difference between esc_* functions?
- How to correctly escape query variables to be used in WP_Query
- How to escape custom css?
- esc_attr / esc_html / esc_url in echos
- When do I need to use esc_html()? [duplicate]
- Escaping WP_Query tax_query when term has special character(s)
- what’s different between esc_attr, htmlspecialchars and htmlentities
- Allow all attributes in $allowedposttags tags
- When outputting a static string to the page, is it necessary to escape the output?
- Escape hexadecimals/rgba values
- How Flexible are the WordPress Coding Standards for PHPCS?
- Sanitizing comments or escaping comment_text()
- How to properly escape a translated string?
- Must I serialize/sanitize/escape array data before using set_transient?
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- How Could I sanitize the receive data from this code
- How to sanitize user input?
- Which escape function to use when escaping an email or plain text?
- WP_Editor – Saving Value into Plugin Option – Stripping HTML
- What is the safe way to print tracking code / pixel code before tag or tag
- Translate a Constant while appeasing WordPress PHPCS
- Using esc_url() on a url more than once
- Do I need to escape get_theme_mod(‘url’) / (‘mail’) with esc_url?
- How to allow   with wp_kses()?
- Using esc_attr_e
- Why esc_html_() is not used on every text that has a translation (on Twenty Twenty One)?
- Escaping crashes my output
- How to escape html generate by a loop
- How to safely escape the title attribute
- Do we need to escape data that we receive from theme options?
- How to safely escape data that contains HTML attributes
- Can wp_strip_all_tags be used as a substitute for esc_url, esc_attr & esc_html?
- Echoing a URL to a link
- wp_kses_post escaping doesn’t appear to work as described?
- file_get_contents | escaping doesnt show the page
- Help about Escaping
- How to keep specific tag from an html string?
- How to use wp_filter_oembed_result?
- Escaping WP_Query tax_query when term has special character(s)
- Escaping and sanitization
- Escaping WP_Query tax_query when term has special character(s)
- Escaping Issues
- Escaping and Special Characters (e.g. &)
- Escaping data from database (users table) is necessary?
- Escaping get_option( ‘time_format’ ) is nesserary?
- esc_url, esc_url_raw or sanitize_url?
- how to sanitizing $_POST with the correct way?
- How should esc_url be combined with trailingslashit?
- Correct way of using esc_attr() and esc_html()
- Escape string Python for MySQL
- Which WP functions do you need to use esc_html() or esc_url() on?
- Reason for Lowercase usernames
- Sanitizing integer input for update_post_meta
- Is sanitize_text_field() is enough to save to DB?
- PHP Coding Standards, Widgets and Sanitization
- How to sanitize select box values in post meta?
- When do I need to use esc_attr when using WordPress internal functions
- Disable escaping html
- I’m confused about URL sanitization in meta boxes
- esc_attr not working in shortcode
- where to apply “apply filters” and other Sanitization Functions
- How to save html and text in the database?
- Escaping / encoding data before insert into a database?
- vs WordPress Security
- Does balanceTags() provide any escaping / protection?
- CSS from textarea in options page to frontend what to do
- How to get rid of shortcodes in post content once and for all
- Sanitize array callback for the WordPress Settings API
- How to escape attachment image caption text?
- Unable to sanitize in customizer and escape in theme without removing ability for user to use “< br >” to insert a line break
- sanitize_text_field and apostrophe problem
- WordPress messes up with data attributes in shortcode output
- textarea field is getting escaped for some unknown reason
- Allow HTML in Settings API input field
- Input sanitation
- WP_Customize_Manager: How to get control ID
- escape html in jQuery for WordPress
- echo cutom css code to WordPress page template file ? is this safe?
- Trouble matching strings (titles) using wp_query
- Sanitize WordPress Array Input?
- Remove pre and code tags from WordPress
- Customizer textarea with script tag won’t work in live preview
- Escaping a Single Quote in str_replace for Nav Function
- wp_kses allow checkbox class and checked
- Comparing pre-saved post_title to post-saved post_title
- Settings api sanatize callback not being triggered
- Sanitizing a custom query’s clauses
- wp_set_object_terms() without accents
- How can I properly sanitize the update_option in WordPress?
- What is the proper way to sanitize $_POST and $_GET vars?