Textpattern 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: 4,571
Website

rvm_latin1_to_utf8 (v0.3)

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!)

Last edited by ruud (2007-11-27 22:48:26)

Offline

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

net-carver
Member
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.3)

Ruud

Yet another useful rvm plugin — thank you.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 5,016
Website

Re: rvm_latin1_to_utf8 (v0.3)

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.org | neme-imca.org | hblack.net | LABS

Offline

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

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,571
Website

Re: rvm_latin1_to_utf8 (v0.3)

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
Member
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.3)

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
Textile | My plugins on GitHub | @netcarver

Offline

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

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,571
Website

Re: rvm_latin1_to_utf8 (v0.3)

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
Member
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.3)

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
Textile | My plugins on GitHub | @netcarver

Offline

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

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,989
Website

Re: rvm_latin1_to_utf8 (v0.3)

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: 5,016
Website

Re: rvm_latin1_to_utf8 (v0.3)

@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.org | neme-imca.org | hblack.net | LABS

Offline

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

net-carver
Member
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: rvm_latin1_to_utf8 (v0.3)

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
Textile | My plugins on GitHub | @netcarver

Offline

Board footer

Powered by FluxBB