Results 1 to 6 of 6

Thread: Weird character encoding?

  1. #1
    papamike is offline Junior Member
    Join Date
    Jan 2010
    Posts
    4

    Exclamation Weird character encoding?

    Hi, I'm having big problem resolving this. I got 1 or 2 pages with this:



    I tried to rebuild the js language.. nothing changed.

    I have other weird bug like this: Notice:

    Uninitialized string offset: 5 in [...]\sugarcrm\include\JSON.php on line 348

    Can someone help me?

    Thanks

  2. #2
    al3
    al3 is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    394

    Default Re: Weird character encoding?

    For the ?s on the screen, try setting your browser to a different Character Encoding (under "view" in Firefox. I use Western-ISO 8859-1.

  3. #3
    mapm's Avatar
    mapm is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Portugal
    Posts
    239

    Default Re: Weird character encoding?

    Try your apache configuration and you mysql database encoding.
    I always use utf8.
    --
    Mário Pereira Martins

    Javali - Administração e Desenvolvimento de Sistemas Informáticos, Lda.
    Madan Parque Edifício VI Campus da FCT/UNL
    Quinta da Torre 2829-516 Caparica Portugal
    Phone: +351 212949666 Fax: +351 212948313
    http://www.javali.pt

  4. #4
    papamike is offline Junior Member
    Join Date
    Jan 2010
    Posts
    4

    Default Re: Weird character encoding?

    The problem is that the bug occur only in 1 or 2 pages with special characters. Other page with same characters works fine. By the way, I'm already using UTF-8 encoding.

  5. #5
    andrew.koltyakov is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Default Re: Weird character encoding?

    We have the same encoding problem with last character in "last viewed" web-part where record name is clipped. Although codepages everywhere as possible are set to UTF-8. Very wierd.

  6. #6
    andrew.koltyakov is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Default Re: Weird character encoding?

    Quote Originally Posted by andrew.koltyakov View Post
    We have the same encoding problem with last character in "last viewed" web-part where record name is clipped. Although codepages everywhere as possible are set to UTF-8. Very wierd.
    I've solved my problem. Ufortunatly for topic creater the reasons of my issue and papamike's are different natures. The reason of "�" in the end of clipped phrasies of Last Viewed in my case is that when cutting UTF-8 string for odd count of unicode letters, substring function tries to cut multibyte letter apart, so "�" apeared.
    My resolution of issue was to replace the following part of /include/MVC/View/SugarView.php:
    PHP Code:
    foreach ( $history as $key => $row ) {
    $history[$key]['item_summary_short'] = getTrackerSubstring($row['item_summary']);
    $history[$key]['image'] = SugarThemeRegistry::current()
    ->
    getImage($row['module_name'],'border="0" align="absmiddle" alt="'.$row['item_summary'].'"');

    for:
    PHP Code:
    $CrD_LastViewed_Length 11;
    foreach ( 
    $history as $key => $row ) {
    $CrD_LastViewed_ShortName $row['item_summary'];
    if (
    mb_strlen($CrD_LastViewed_ShortName,'UTF-8') > $CrD_LastViewed_Length){
    $CrD_LastViewed_ShortName mb_substr($CrD_LastViewed_ShortName,0,$CrD_LastViewed_Length,'UTF-8'). '...';
    }
    $history[$key]['item_summary_short'] = $CrD_LastViewed_ShortName;
    $history[$key]['image'] = SugarThemeRegistry::current()
    ->
    getImage($row['module_name'],'border="0" align="absmiddle" alt="'.$row['item_summary'].'"');

    You can setup length of Last Viewed elements by variable $CrD_LastViewed_Length.
    Nevertheless, I do not sure that it the best solution.
    Last edited by andrew.koltyakov; 2010-03-30 at 07:48 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SOAP set_entry character encoding
    By jry in forum Developer Help
    Replies: 2
    Last Post: 2009-08-21, 12:39 AM
  2. Character encoding in MSSQL
    By dricrm in forum Developer Help
    Replies: 2
    Last Post: 2008-03-19, 12:02 PM
  3. Zucker Reports UTF 8 Character Encoding
    By richardp in forum Japanese
    Replies: 0
    Last Post: 2007-07-27, 07:18 AM
  4. Character set encoding in exporting issue
    By vifosys in forum General Discussion
    Replies: 0
    Last Post: 2007-06-19, 06:01 AM
  5. Character Encoding
    By monsieurgerard in forum Deutsche
    Replies: 0
    Last Post: 2005-12-08, 04:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •