Results 1 to 3 of 3

Thread: ZuckerReports character set problem

  1. #1
    balou is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Shanghai
    Posts
    10

    Default ZuckerReports character set problem

    Hello,

    I'm experiencing some issue with the ZuckerReports module when I want to perform a report (whatever an inline report/HTML/CSV/Word Template/...). I try to print chinese characters, however they appear as if the were displayed/managed via another charset than UTF8 : ie. "�贵����"

    My database is set as UTF-8, php.ini has the default charset set as UTF-8, sugarCRM is set as UTF8, characters are showed in a correct way in all the modules (names - addresses), except in Zucker

    Is there anyway to show them in real chinese ? ie. "啤酒好喝"
    Is there some kind of filter in zucker that mess with my characters?

    Any help would be graetly appreciated !

    Regards,

    Balou

    PS: i like zucker too much to get rid of it ! damned 汉字

  2. #2
    balou is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Shanghai
    Posts
    10

    Default Re: ZuckerReports character set problem

    Hello me,

    Problem is solved now.

    Reason was : in
    Code:
    module/ZuckerQueryTemplate/querytemplate.php
    the htmlentities function was missused, using in fact the default parameters like the default charset ISO-8859-1
    It works for most of the folk, that's true but with other charsets we need to make a modification.

    Solution :
    replace
    PHP Code:
    htmlentities($row[$field]) 
    with
    PHP Code:
    htmlentities($row[$field],ENT_COMPAT,'UTF-8'
    or whatever other charset you use.

    Cheers

  3. #3
    pikpik is offline Junior Member
    Join Date
    Oct 2007
    Posts
    4

    Smile Re: ZuckerReports character set problem

    Hello you!

    I've had exactly the same problem as you, I could display all my entries in every module except in Zucker Reports (and actually, Zucker reports IS what we need) where weird signs were displayed so I first supposed there was a problem with the character set.

    I also checked the results on my server, using putty to type in sql queries in the mysql shell, and accents (for french language) were displayed correctly on my server's screen. So I guessed the problem wasn't coming from my query, and the result sent by my server had to be good, it was just the display function having a trouble.

    The solution was the following (greatly inspired by yours):

    just kick off the htmlentities function in the PHP code of the QueryTemplate.php file.

    Nice, it works for me!
    Last edited by pikpik; 2007-10-17 at 03:17 PM.

Thread Information

Users Browsing this Thread

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

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
  •