1
skyangelo
Chinese character become "character code"
  • 2010/1/8 23:11

  • skyangelo

  • Just popping in

  • Posts: 79

  • Since: 2005/4/9 1


After upgrading XOOPS from 2.4.2 to 2.4.3, the titles of my post in news module containing Chinese character are now displayed as "character code" (like 〹), while the (Chinese character) content in the post are displayed normally.
I checked the non UTF-8 part and I have already set the "define('_CHARSET', 'ISO-8859-1');" from 2.4.x.
I don't know how to fix it...
Thanks!

2
ghia
Re: Chinese character become "character code"
  • 2010/1/9 1:40

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


What is the character set and collation for the news stories table (see phpMyAdmin)?
What char set is defined in mainfile.php?
And in global.php?

3
skyangelo
Re: Chinese character become "character code"
  • 2010/1/9 13:18

  • skyangelo

  • Just popping in

  • Posts: 79

  • Since: 2005/4/9 1


I think there are a lot of difference in charset/collation....

MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: latin1_general_ci
stories tables: collation: latin1_general_ci
topics table: collation: latin1_german2_ci

global.php: define('_CHARSET', 'ISO-8859-1');
mainfile.php: did not set anything...
// Set the database charset if applicable
if (defined("XOOPS_DB_CHARSET")) die();
define( 'XOOPS_DB_CHARSET', '' );

Anyway I know that my site is not UTF-8, so I just change the charset in global.php to ISO-8859-1 then it worked fine when I upgraded to XOOPS 2.4.1/2, but when I upgraded to XOOPS 2.4.3, then I had this issue...

4
skyangelo
Re: Chinese character become "character code"
  • 2010/1/9 13:36

  • skyangelo

  • Just popping in

  • Posts: 79

  • Since: 2005/4/9 1


what I don't understand is that only the title is not well displayed but the content is fine...
Resized Image

5
ghia
Re: Chinese character become "character code"
  • 2010/1/9 13:58

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Is this also for new articles or only for exisiting articles?
What is stored in the database in the title field?

(The latin1 collation was never meant to store chinese, so this may become problematic.)
Maybe you could try to adapt your template with the following example:
<{$articleTitle|replace:'&':'&'}>


6
trabis
Re: Chinese character become "character code"
  • 2010/1/9 14:22

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I believe you are talking about browser page title when accessing index.php?

If so edit modules/news/item.php

Change line 204 into:
if($firsttitle=='') {
                   
$firsttitle=$thisstory->topic_title() . ' - ' .  $thisstory->title();
               }

Change line 308 into:
/**
 * Assign page's title
 */
if($firsttitle!='') {
    
$xoopsTpl->assign('xoops_pagetitle'$firsttitle ' - ' $myts->htmlSpecialChars($xoopsModule->name()));
} else {
    if(
$topictitle!='') {
        
$xoopsTpl->assign('xoops_pagetitle'$topictitle);
    } else {
        
$xoopsTpl->assign('xoops_pagetitle'$myts->htmlSpecialChars($xoopsModule->name()));
    }
}

7
skyangelo
Re: Chinese character become "character code"
  • 2010/1/9 15:27

  • skyangelo

  • Just popping in

  • Posts: 79

  • Since: 2005/4/9 1


When I create new topic name with Chinese character, it's the same pb.
Where shall I replace the template?

8
skyangelo
Re: Chinese character become "character code"
  • 2010/1/9 15:30

  • skyangelo

  • Just popping in

  • Posts: 79

  • Since: 2005/4/9 1


Not only the page title but also the topic title in the page.
All the Chinese characeters in my topics are not well displayed and I don't know why. It just happened after upgrading from XOOPS 2.4.2 to 2.4.3.

P.S. I can not find item.php in News module..

9
ghia
Re: Chinese character become "character code"
  • 2010/1/9 15:51

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Alternative, restore the /class/module.textsanitizer.php and /class/textsanitizer/syntaxhighlight/syntaxhighlight.php from the previous XOOPS version.

10
andrey3761
Re: Chinese character become "character code"


Login

Who's Online

248 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 248


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits