Unicode content display wrong

This topic contains 5 replies, has 4 voices, and was last updated by  berniezhao 9 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #58215

    berniezhao
    Expired Member
    Post count: 16

    Hi,

    I just started using GD and first of all thanks for the great work.
    I’m doing translation to Asian languages (Chinese) and found that some pages are displaying characters incorrectly. Check the attachment for the wrong category display on home page and the correct display on detail page.
    I was able to track down this category display to

    geodirectory-functionsgeneral_functions.php
    
    
    
    echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
    echo '<img alt="' . $cat->name . ' icon" class="" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> ';
    echo ucwords($cat->name) . ' (<span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '" >' . $total_post . '</span>) ';
    echo '</a></li>';
    

    Here ucwords() might have issues with multi-byte characters. It will try convert the first byte and mess up with UTF multi-byte character.

    I did a search of ucwords() and seems like this has been used in quite some scripts. This might be a show stopper for GD when considering any multi-byte translation (typically Asian languages). I’m wondering if there is any plan for fixing or if we can patch it locally as a temporary workaround. Any help is appreciated.

    Thank you.

    #58235

    Guust
    Moderator
    Post count: 29970

    I alerted the developers for you, I am sure you will hear from them soon.

    #58294

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    we can use mb_convert_case() instead of ucwords(). We have added a task for the developers. We’ll let you know as soon as this is fixed.

    Thanks for spotting this!

    #58320

    berniezhao
    Expired Member
    Post count: 16

    Yes mb_convert_case() should be good. Thanks! Let us know.

    #58551

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    this has been fixed and will be in the next release.

    Thanks,

    Stiofan

    #58686

    berniezhao
    Expired Member
    Post count: 16

    Thank you @stiofan!

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount