Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28081

    There is a problem with breadcrumb when using Japanese (or any non-ascii language). When a title is truncated because it is too long, it doesn’t cut off at a character boundary of UTF-8 (Unicode).

    Please take a look at the right-side of the header breadbrumb at:

    http://jp.emeditor.org/emeditor-%E3%81%AF-%E3%82%B7%E3%82%A7%E3%82%A2%E3%82%A6%E3%82%A7%E3%82%A2%E6%A5%AD%E7%95%8C%E8%B3%9E-%E3%81%AB%E3%81%A6%E6%9C%80%E5%84%AA%E7%A7%80%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7/

    the two characters at the right (“��”) indicate UTF-8 characters are not correctly truncated.

    Please fix this issue.

    Thank you,

    #136387

    Hi,

    Searching for a fix, I found this solution. If your PHP settings have ‘Multibyte String : mbstring.encoding_translation’ turned on, some special characters will not display, and cut any content following them. Can you please ask your host to disable this setting?

    Regards,

    Ismael

    #136388

    Hello Ismael,

    Thanks for taking this. mbstring.encoding_translation was turned off. See phpinfo at http://www.emeditor.org/phpinfo.php

    I actually wrote this at a separate topic, and I wrote this same thing:

    With a little search, I found a similar article:

    http://stackoverflow.com/questions/8484162/how-to-truncate-an-utf8-string-in-php

    I think using mb_strimwidth instead of substr will resolve this issue.

    Would that help?

    Thanks again,

    #136389

    Hey,

    Edit framework > php > class-breadcrumb.php, find this code:

    /* Set up the default arguments for the breadcrumb. */
    $defaults = array(
    'separator' => '»',
    'before' => '<span class="breadcrumb-title">' . __( 'You are here:', 'avia_framework' ) . '</span>',
    'after' => false,
    'front_page' => true,
    'show_home' => __( 'Home', 'avia_framework' ),
    'echo' => false,
    'show_posts_page' => true,
    'truncate' => 70,
    'richsnippet' => false
    );

    Replace truncate with ‘140’ or something higher.

    /* Set up the default arguments for the breadcrumb. */
    $defaults = array(
    'separator' => '&raquo;',
    'before' => '<span class="breadcrumb-title">' . __( 'You are here:', 'avia_framework' ) . '</span>',
    'after' => false,
    'front_page' => true,
    'show_home' => __( 'Home', 'avia_framework' ),
    'echo' => false,
    'show_posts_page' => true,
    'truncate' => 140,
    'richsnippet' => false
    );

    Regards,

    Ismael

    #136390

    Thanks for your assistance. Actually, changing mb_strimwidth instead of substr code at:

    wp-contentthemesenfoldframeworkphpfunction-set-avia-backend.php

    fixed all.

    Thanks!

    #136391

    Hey,

    I tested the code above and it should work too. Glad you fixed it. :)

    Cheers,

    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Title breadcrumb in the header is not truncated correctly with Unicode’ is closed to new replies.