[wp-trac] [WordPress Trac] #22909: Special charters are not displayed properly on the menus

WordPress Trac noreply at wordpress.org
Sat Dec 15 13:09:08 UTC 2012


#22909: Special charters are not displayed properly on the menus
-------------------------------+------------------------------
 Reporter:  varna_city         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Menus              |     Version:  3.5
 Severity:  critical           |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------
Changes (by toscho):

 * keywords:  needs-patch reporter-feedback => reporter-feedback


Comment:

 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>';
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22909#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list