Opened 5 months ago
Last modified 5 months ago
#22909 new defect (bug)
Special characters are not displayed properly on the menus
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Menus | Version: | 3.5 |
| Severity: | normal | Keywords: | reporter-feedback |
| Cc: | info@… |
Description (last modified by SergeyBiryukov)
The previous version of Wordpress 3.4 did handle special characters like ★ and ✄ pretty well. Wordpress 3.4 displays such special characters and they can be used on the Wordpress menus, however in version 3.5, these characters are displayed as empty squares, which does mean that 3.5 can't recognize them properly.
Attachments (1)
Change History (12)
comment:3
varna_city — 5 months ago
Hi, I've tested it with different browsers, the problem is the Wordpress system. When I downgraded to Wordpress 3.4 everything is fine again. I think that Wordpress 3.5 is just using a wrong encoding for the menus in contrast to Wordpress 3.4.
comment:4
SergeyBiryukov — 5 months ago
- Keywords reporter-feedback added
Could you provide some steps to reproduce the issue?
I've tried adding "★ and ✄" to a menu name and to individual menu item labels, and they still display correctly in 3.5. Tested in Firefox 17.
comment:5
SergeyBiryukov — 5 months ago
Also, which browser and OS?
comment:6
varna_city — 5 months ago
I did try to do it on another site and the same issue is present. OS tested: Windows 7 and Windows 8. Browsers: IE9, IE10, Firefox 17.0.1, Opera latest stable, Chrome latest stable, Safari for Windows 5.1.7. A friend of mine with Windows 7 and Firefox 17.0 did open the two sites and got the same issue. Wordress 3.4 is working fine, 3.5 - had a bug into the menus.
comment:7
SergeyBiryukov — 5 months ago
Steps to reproduce?
- Keywords needs-patch removed
My guess: Your plugin is not properly encoded or your OS is lacking the fonts with these characters. The plugin has to be UTF-8 without a BOM. See attached test plugin. Tested in two installations, Win 7 and Cent OS.
Code:
<?php
/**
* Plugin Name: Test Non-ASCII Characters In Menus
* Plugin URI: http://core.trac.wordpress.org/ticket/22909
*
* This file is encoded in UTF-8 without BOM. Do not change that.
*/
add_action( 'admin_menu', 'tnacim_add_menu' );
/**
* Register menu with a funny title.
*
* @wp-hook admin_menu
* @return void
*/
function tnacim_add_menu()
{
add_menu_page(
'✂ ✉ ✔✽ ✾ ✿ ❀ ❉ ❤',
'❦ ☂ ☔ ☎ ☘ ♫ ♻ ⚥',
'edit_posts',
'tnacim',
'tnacim_callback'
);
add_submenu_page(
'tnacim',
'⁂‖‣‗•⁁※‼‽℡№℠↹↯',
'☠☢☣☮☯☹✂✍✎',
'edit_posts',
'tnacim-sub',
'tnacim_callback'
);
}
/**
* Print menu pages.
*
* @return void
*/
function tnacim_callback() {
$glob = array ();
foreach ( $GLOBALS as $k => $v )
is_scalar( $v ) and $glob[ $k ] = $v;
ksort( $glob );
print '<h1>' . $GLOBALS['title'] . '</h1>';
print '<pre>'
. htmlspecialchars(
print_r( $glob, TRUE ), ENT_QUOTES, 'utf-8', FALSE
)
. '</pre>';
}
comment:9
DrewAPicture — 5 months ago
- Summary changed from Special charters are not displayed properly on the menus to Special characters are not displayed properly on the menus
comment:10
SergeyBiryukov — 5 months ago
- Severity changed from critical to normal
comment:11
SergeyBiryukov — 5 months ago
- Description modified (diff)

Empty squares are usually an indicator for a browser issue: your browser cannot find a font on your operating system to render these characters. Check your font list and try another browser.