Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-25 20:47:32

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

rvm_latin1_to_utf8 (v0.5)

This plugin helps you to change the character set in tables, created with MySQL versions older than 4.1, from ‘latin1’ to ‘utf8’ after you’ve upgraded to MySQL 4.1 or higher.
Please read the plugin documentation carefully before using this plugin.

Download

Features:

  • After plugin installation, just 2 clicks are needed to do let it do its job.
  • Can handle textpattern tables with modified columns or additional indexes.
  • Additional tables, created by plugins can also be upgraded (optional).
  • Detailed documentation in the plugin help.

Changelog:

  • version 0.1 (2007-11-25)
  • version 0.2 (2007-11-26)
    • allow user to select tables for upgrade that are not standard TXP tables, but do have the same prefix.
    • fixed PHP warning for tables without indexes (thanks wet!)
    • some small cosmetic/code changes.
  • version 0.3 (2007-11-27)
    • fixed PHP warning in the generation of TXP page_top tabs (thanks colak!)
  • version 0.4 (2017-01-26)
    • compatibility with TXP 4.6+
  • version 0.5 (2017-07-22)
    • add missing semicolon in line added to config.php

Last edited by ruud (2017-07-22 15:07:46)

Offline

#2 2007-11-26 00:26:33

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.5)

Ruud

Yet another useful rvm plugin — thank you.


Steve

Offline

#3 2007-11-26 08:18:18

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

Re: rvm_latin1_to_utf8 (v0.5)

hi Ruud,
Thanks for this. At last I’ll be able to upgrade the db charset!

Will this plugin work ok when there are 2 txp installs in the same db?

>Edit. I also have a txp install in the same db with punbb. Would this be a problem?

Last edited by colak (2007-11-26 08:59:31)


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

Offline

#4 2007-11-26 10:00:28

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

Re: rvm_latin1_to_utf8 (v0.5)

The plugin only changes the tables with the same table prefix as the textpattern install where the plugin was installed, so if you have 2 TXP installs in 1 database, you’ll have to install/run the plugin in both TXP installs.

Currently only tables that really belong to TXP are converted (textpattern, txp_page, txp_css etc), so if you have a plugin that creates a table called txp_example, then that table will not be converted automatically.

I’m thinking about also including extra tables with that same TXP table prefix that were added by other plugins, to avoid having to update those manually, but that’s a bit more risky, especially if you didn’t specify a prefix for your textpattern install and there are other, non-TXP related tables in your database.

Offline

#5 2007-11-26 10:12:52

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.5)

ruud wrote:

I’m thinking about also including extra tables with that same TXP table prefix that were added by other plugins, to avoid having to update those manually, but that’s a bit more risky, especially if you didn’t specify a prefix for your textpattern install and there are other, non-TXP related tables in your database.

Complicates the simple; but a list of tables with a “convert this” checkbox next to each one and a Go! button at the foot would allow the user to make the final choice. You could initially check only those tables from the default TXP install — and others using the same prefix (if any).


Steve

Offline

#6 2007-11-26 11:50:50

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

Re: rvm_latin1_to_utf8 (v0.5)

Tables used by plugins should use the same prefix as TXP tables, so in that case I’d probably show all tables that are not normally part of a TXP install (the standard TXP tables should be converted anyway, so there’s no point in showing those) and let the user check them if he’s certain that they belong to the TXP install…. but how many plugins create separate tables that contain UTF-8 data? Is it worth adding this functionality?

Offline

#7 2007-11-26 13:21:48

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.5)

ruud wrote:

Tables used by plugins should use the same prefix as TXP tables, so in that case I’d probably show all tables that are not normally part of a TXP install (the standard TXP tables should be converted anyway, so there’s no point in showing those) …and let the user check them if he’s certain that they belong to the TXP install.

Yes, that would simplify the list — possibly down to nothing in which case you can just go anyway.

… but how many plugins create separate tables that contain UTF-8 data? Is it worth adding this functionality?

I don’t know if it’s worth adding this — like I said earlier, it complicates the simple. Maybe folks just starting off their plugin writing careers might not prefix tables they create (in which case, the plugins probably aren’t going to be adding new tables anyway.)


Steve

Offline

#8 2007-11-26 13:57:29

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rvm_latin1_to_utf8 (v0.5)

Great!

I used to use this textsnippet to do the job.

A question:

A client’s site is running a TxP 4.0.5 + MLP on a MySQL 4.0.18, so it’s currently running on a latin1 db.
When MySQL gets updated (don’t know when will it happen), I would like to try this plug-in to update the DB.
But, ruud says that this only works over tables that belongs to TxP.

So, what about the MLP? does any table that belongs to MLP also need to be converted? I think translated articles are stored in the standard TxP table, but what about things like snippets?

Thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2007-11-26 14:22:09

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

Re: rvm_latin1_to_utf8 (v0.5)

@ruud… I just successfully updated hblack.net…Thanks! How do we manually change the tables created by plugins?

I have 2 remaining tables “txp_log_mention” which I’m almost sure I do not use any more and “txp_js” which is created by the “stm_javascript” plugin

Steve wrote

Complicates the simple; but a list of tables with a “convert this” checkbox next to each one and a Go! button at the foot would allow the user to make the final choice. You could initially check only those tables from the default TXP install – and others using the same prefix (if any).

Great idea!


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

Offline

#10 2007-11-26 14:46:43

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.5)

maniqui wrote:

A client’s site is running a TxP 4.0.5 + MLP on a MySQL 4.0.18, so it’s currently running on a latin1 db.
When MySQL gets updated (don’t know when will it happen), I would like to try this plug-in to update the DB.
But, ruud says that this only works over tables that belongs to TxP.
So, what about the MLP? does any table that belongs to MLP also need to be converted?

Yes, the ‘l10n_’ tables would need to be converted too. If your installation is using a table prefix, then that will be taken care of by ruud’s idea of converting all tables which match the Txp table prefix. However, you could use your script method for those.

I think translated articles are stored in the standard TxP table, but what about things like snippets?

Snippets are all stored in the existing txp_lang table so they will be taken care of by ruud’s plugin anyway.

BTW: Latest MLP doesn’t allow installation attempts on MySQL pre-version 4.1.

Ruud

So there is some need for Txp plugins’ table conversions after all — and from my own work! (Dusts off hat in preparation for a meal.) But does that present enough demand to implement the UI for this?


Steve

Offline

#11 2007-11-26 15:20:33

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

Re: rvm_latin1_to_utf8 (v0.5)

Yiannis
I’ll try to get an new version of the plugin ready tonight that can also handle the other tables (I assume your TXP prefix is either ‘txp_’ or empty, right?)

Julián
All tables that contain UTF-8 data have to be converted. If there’s no UTF-8 data stored, it’s still nice to get the charset/collation for the table itself corrected (if you’re a perfectionist like me), but you won’t notice the difference.

Steve
Exactly, if people have only the standard TXP tables, no extra question would be asked. I’ll start working on this tonight.
For plugins that don’t correctly use the TXP database prefix to access their own created tables, people will have to manually make table changes because chances are those tables don’t even contain UTF8 (and I don’t want to risk changing things like that).

Offline

#12 2007-11-26 15:42:10

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

Re: rvm_latin1_to_utf8 (v0.5)

ruud wrote:

Yiannis
I’ll try to get an new version of the plugin ready tonight that can also handle the other tables (I assume your TXP prefix is either ‘txp_’ or empty, right?)

Hi ruud

Well, in hblack.net it is txp_ or empty as far as the textpattern table goes

The other sites get a bit more complicated. neme.org/main has an a_ prefix and I also have another txp install in there with the standards txp_ and empty.
The neme.org also has 2 installs. The tables for punBB and a txp install with a test_ prefix.


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

Offline

Board footer

Powered by FluxBB