Re: mysql encoding xaraya nightmare
"Robert Ševčík (Robajz)" <[email protected]>
| Newsgroups | gmane.comp.cms.xaraya.user |
|---|---|
| Message-ID | <[email protected]> |
Hello, I don't think stein is right. I once had the same problem and the data were really mess in the DB. The problem is, Xaraya puts the data in MySQL in UTF-8 and then the mysql client recodes them again to UTF-8 - that means it encodes already encoded text, which then becomes a mess. This is still perfectly fine for Xaraya since the client decodes the data from utf-8 and the xaraya again treats it as utf-8. My solution for this was to execute "SET NAMES utf8" or something like that after openin a connection in Xaraya. Check the MySQL manual. I modified the xarDB.php to do this. I think I have also submited a bug on this, but couldn't find it now. Now that you have the mess in DB already, this won't help. I'd recomend to export all your DB data and let it go through some recode or iconv tool to decode it from utf-8, then import again in DB and modify the xarDB.php. HTH, Robert. On 06/04/07, Jason <[email protected]> wrote: > "stein" <[email protected]> wrote in message > news:[email protected]... > > I'm converting a portion of a Xaraya installation to Drupal and have a big > > problem. > > > > Background: > > PHP 4.3.9, Apache 2.0.52, mysql 4.1.20 > > Xaraya base set to "Full Multilanguage" and en_US.utf-8 > > > > Users post content in both English and Japanese. > > > > Content with Japanese characters displays perfectly fine on the Xaraya > > site. > > > > PROBLEM: > > Content with Japanese characters appears as gibberish in the mysql > > tables > > (viewing in phpmyadmin) > > and when copied into the Drupal database appears as gibberish in > > Drupal... > > > > Example: > > ?????? appears fine on the site but in the mysql database, it appears > > (in > > phpmyadmin) > > as ã(c)ã?ã§ã-ãYã<? > > > > anyone have any ideas? Any help or hints would be a lifesaver :-)! > > The only thing I would say is: do not trust phpMyAdmin. > > You just don't have the proper control over encoding. It tries to be too > clever and recodes characters if it sees fit, but it does not tell you that > it is doing the recoding. For example, when you import and export, there is > no option to tell it what character set to use in the export, or whether to > recode the data or not, or what character set to use to interpret the import > file. > > How phpMyAdmin determines when to reencode or not reencode, is something > I've never quite got my head around. Try exporting and importing using the > command-line tools instead. You may have more luck. > > -- JJ > > > > _______________________________________________ > Xaraya_user mailing list > [email protected] > http://xaraya.com/mailman/listinfo/xaraya_user > > -- Robert Ševčík (Robajz) [email protected] http://robajz.info ICQ: 155643210 BÚ: 563720001/2400 IBAN: CZ3924000000000563720001 SWIFT: EBNKCZPP _______________________________________________ Xaraya_user mailing list [email protected] http://xaraya.com/mailman/listinfo/xaraya_user