PEAK XOOPS - d3forum and the import function in englishin japanese

d3forum and the import function

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 .2 | Posted on 2007/3/24 3:55
plusangel  ¾åÅùʼ   Posts: 32
Dear GiJOE,

I encountered a strange problem with the import function of d3forum.

Let me explain,

I have a xoops 2.0.16a JP site (greek site), i'm using xhnewbb 1.3o without any problem. The site is on utf-8 encoding (langocode-el), on mysql 4.1.x server - php 4.4.x. (utf_general_ci collation).

I decided to install d3forum 0.49. The installation procedure was successful. Next step was to import the data from the xhnewbb. I clicked to the "import" button and everything done ok.

When I checked the forum of d3forum module all the greek characters imported as ??????.

What happened?

The strange thing is that a couple of months ago, i tried the same thing on a local copy of my site with d3forum 0.43 and everything was correct!!! The only difference with the live configuration are the php and mysql versions (Php v5.1.6::MySQL v5.0.24).

Do you have any idea what is going on?
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/3/24 4:21 | Last modified
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi plusangel.

It must be a problem of MySQL.
Have you patched
mysql_query( "SET NAMES (your character)" , $this->conn ) ;
in your mysqldatabase.php ?

    function connect($selectdb = true)
    {
        if (XOOPS_DB_PCONNECT == 1) {
            $this->conn = @mysql_pconnect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB
_PASS);
        } else {
            $this->conn = @mysql_connect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_
PASS);
        }

        if (!$this->conn) {
            $this->logger->addQuery('', $this->error(), $this->errno());
            return false;
        }

        if($selectdb != false){
            if (!mysql_select_db(XOOPS_DB_NAME)) {
                $this->logger->addQuery('', $this->error(), $this->errno());
                return false;
            }
        }
        mysql_query( "SET NAMES (your character)" , $this->conn ) ; // here
        return true;
    }
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/3/25 2:49
plusangel  ¾åÅùʼ   Posts: 32
I've patched this file since the beginning (initial setup)

More precise, the specific function looks like this:
Quote:
function connect($selectdb = true)
{
if (XOOPS_DB_PCONNECT == 1) {
$this->conn = @mysql_pconnect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS);
} else {
$this->conn = @mysql_connect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS);
}

if (!$this->conn) {
$this->logger->addQuery('', $this->error(), $this->errno());
return false;
}

if($selectdb != false){
if (!mysql_select_db(XOOPS_DB_NAME)) {
$this->logger->addQuery('', $this->error(), $this->errno());
return false;
}
}
mysql_query('SET character_set_results="utf8"');
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");
return true;
}

I haven't encounter any encoding problem so far. Probably I will experiment a bit with mysql versions, probably something change between 4.1.x and 5.0.x
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2007/3/25 3:43
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hmmm.

Check the table's charset via phpMyAdmin etc.

Perhaps, they are different each other.
- tables of xhnewbb
- tables of d3forum
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/3/26 3:43
Mikhail  °ìÅùʼ From: Rio de Janeiro, Brasil  Posts: 15
hi, angelus!

strange.... I'm using d3forum with imported data from CBB and using portuguese language files encoded with utf-8, with no problems....

another way is: after import the sql from xhnewbb, export and (re)convert the sql data to utf-8 (with a tool like iconv or ultraedit).....


[]'s!


mikhail




Quote:

plusangel wrotes:
Dear GiJOE,

I encountered a strange problem with the import function of d3forum.

Let me explain,

I have a xoops 2.0.16a JP site (greek site), i'm using xhnewbb 1.3o without any problem. The site is on utf-8 encoding (langocode-el), on mysql 4.1.x server - php 4.4.x. (utf_general_ci collation).

I decided to install d3forum 0.49. The installation procedure was successful. Next step was to import the data from the xhnewbb. I clicked to the "import" button and everything done ok.

When I checked the forum of d3forum module all the greek characters imported as ??????.

What happened?

The strange thing is that a couple of months ago, i tried the same thing on a local copy of my site with d3forum 0.43 and everything was correct!!! The only difference with the live configuration are the php and mysql versions (Php v5.1.6::MySQL v5.0.24).

Do you have any idea what is going on?
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/3/26 20:32
plusangel  ¾åÅùʼ   Posts: 32
Dear GiJOE,

the problem is exactly what you guess.

After a fresh installation of d3forum, I noticed that all the tables have latin1_swedish_ci (the only ones). So even if I do a simple data entry (without importing) the result is the same - "????????".

If I change, manually via phpMyAdmin, the field collation everything is working fine.

My hosting environment has MySQL 4.1.21 server. In contrary, in my local place that I have 5.0.24 I don't have any problem.

So probably I have to hack the mysql.sql file in order to declare the exact collation. The idea to change manually all the fields of all the tables using phpMyAdmin probably is too time demanding...

@Mikhail

Thanks for the info about encodings conversions, I usually play with ultraEdit too!
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2007/3/27 20:26
plusangel  ¾åÅùʼ   Posts: 32
By modifying the mysql.sql file and declare the COLLATE parameter to utf8_general_ci, d3forum working fine.


So we go on now!
Votes:2 Average:10.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!