Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2007-11-27 06:12:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

Hi ruud… Just used 0.2 to convert the remaining 2 tables. THe conversion seems that it happened just fine but the following error was returned.

Warning: Invalid argument supplied for foreach() in /users/home/mine/domains/hblack.net/web/public/hblack/textpattern/lib/txplib_head.php on line 220
The db is still using latin1

Regardless of the error all seems fine though.

Last edited by colak (2007-11-29 08:24:16)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#17 2007-11-27 08:52:06

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_latin1_to_utf8 (v0.5)

Textpattern doesn’t create the database, just the tables, so I think it should not try changing the database.

Can anyone confirm the error that Yiannis is getting? I can’t reproduce it and the array used in that foreach loop looks okay, so I’m wondering what is causing the error.
Yiannis, which PHP version and TXP version are you using… and where exactlly on the page does the error appear?

Last edited by ruud (2007-11-27 09:20:56)

Offline

#18 2007-11-27 11:54:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

Hi ruud

I am using txp version: 4.0.5 (r2466), PHP version: 5.1.4 and MySQL: 4.1.18

The error appeared on the page which came up after converting the tables.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#19 2007-11-27 12:00:46

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_latin1_to_utf8 (v0.5)

Hmm… so it doesn’t show on the page that allows you to check which tables to convert, but only shows on the final page that shows the message about successfully updating the tables? If so (which makes it even stranger, unless it’s a conflict with another plugin), where exactly on that page does the error show…. at the top, or at the bottom, below/above which part of the page?

Last edited by ruud (2007-11-27 12:07:21)

Offline

#20 2007-11-27 13:05:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

Hi ruud.

It showed just under the header. In the white part of the page.

If you like, I can reinstall from the backup and grand you access if it is of help to you. The site works just fine though.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#21 2007-11-27 13:08:36

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

Hmmm… Would it be because my config file was already on utf8 from the previous conversion?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#22 2007-11-27 13:16:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_latin1_to_utf8 (v0.5)

No, the error you mentioned is in the part that creates the tabs at the top (part of core TXP, not the plugin, really), so it can’t be related to the config.php file.

Having direct access would certainly help to track down what’s causing it.

Offline

#23 2007-11-27 16:36:08

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

I just reinstalled the old db on the site and also added you as a publisher… So do expect a mail:)

>Edit You will also need access to the ftp to change the config file, I’ll send you the l/p just now…

Last edited by colak (2007-11-27 16:40:38)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2007-11-27 22:49:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_latin1_to_utf8 (v0.5)

version 0.3 is available that fixes the PHP warning Yiannis found. Thanks for letting me log in on your website and test a few things. That helped a lot.

Offline

#25 2007-11-28 14:34:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

Hi ruud… It was the least I could do as you are the one who’s swetting it out on this.

Used v0.3 and all went well.

Since all the tables of the database are now using utf8, is there a way – and would it be prudent – to alter the whole db to utf8?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#26 2007-11-28 14:58:37

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_latin1_to_utf8 (v0.5)

Assuming your database is called ‘colak’, run the following SQL query:

ALTER DATABASE colak CHARSET utf8 COLLATE utf8_general_ci;

From the MySQL documentation:

The database character set and collation are used as default values if the table character set and collation are not specified in CREATE TABLE statements. They have no other purpose.

If you don’t have any non-TXP tables in that database, it won’t hurt changing the charset, but if you plan on having other applications create tables in that database, changing the charset from latin1 to utf8 might have some unexpected results.

I figured that since TXP doesn’t create the database, it should not change it either.

Offline

#27 2007-11-28 16:18:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,368
Website GitHub Mastodon Twitter

Re: rvm_latin1_to_utf8 (v0.5)

ruud wrote:

If you don’t have any non-TXP tables in that database, it won’t hurt changing the charset, but if you plan on having other applications create tables in that database, changing the charset from latin1 to utf8 might have some unexpected results.

Hmmm… That answers it:) My life is complicated enough for now:)

Last edited by colak (2007-11-28 16:18:49)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#28 2007-12-02 08:51:32

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: rvm_latin1_to_utf8 (v0.5)

I have a TXP install on Nicola/TextDrive, which I have to migrate to Prospect on Joyent Open Solaris. I posted about this issue on the Joyent forum.

After following the Joyent Wiki instructions – export the database in Latin1, then change all instances of Latin1 to UTF8, then import to Prospect – I notice the foreign characters are still mangled.

Wet suggested that I try this plugin, and I did, but it made no difference for me. The only other thing I can think of is php.ini setting (UTF-8 on Joyent) or something to do with the database on Nicola.

In the dump from Nicola, the foreign characters look mangled when I open the file in Text Wrangler. Don’t know if that’s normal…

Offline

#29 2007-12-02 10:50:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_latin1_to_utf8 (v0.5)

My plugin doesn’t change the stored data, just the charset/collation labels on the tables. If the charset/collation is already set to utf-8 and the characters are still mangled then you have a different problem.

If Textdrive offers MySQL 4.1 or higher, you could run my plugin there, then export in utf8 and import in utf8 on the new server (or export/import both in latin1)…. but do make backups before modifying the original database.

Step 5.II in that Joyent migration manual is essentially the same as what my plugin does, only without requiring export/import and manual changes.

Offline

#30 2007-12-02 11:03:15

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: rvm_latin1_to_utf8 (v0.5)

Hi Ruud,

I really can’t figure it out. Nicola on TextDrive uses MySQL 4.1.22, but when the TXP install was made a couple years back it must have been a lower version.

php.ini default charset on Nicola (the old install) is set to ISO-8859-1, while Joyent’s new servers are all pure UTF-8.

I will try using your plugin on a copy of the DB on Nicola, and report back…

Edit: On Nicola, phpMyAdmin settings are: MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_unicode_ci

Last edited by jstubbs (2007-12-02 11:05:06)

Offline

Board footer

Powered by FluxBB