Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
workflow suggestions for retaining foreign characters
I’m about to start a new project and want to get it right this time :-)
What are your suggestions? Here’s my working method?
- I develop the site offline on a XAMPP local webserver with MySQL 4.1.x, i.e. standard database support ist UTF.
- I upload the database later to the remote host which has MySQL 3.2x or 4.0 and so does not support UTF.<br />To get it the database to transfer I have to export out of phpmyadmin with the backwards compatible option. That works (most of the time).
My problem: Once online the foreign characters look like ~A and ? etc. and in the past I have had to correct all the foreign characters (German umlauts) in the posts, subfields, custom fields etc. manually, which is okay for a handful of articles but not for hundreds. BTW: those previous sites were RC3 in various different revisions.
Maybe this problem is now resolved in Textpattern 4.01, maybe not?
Can I improve my workflow by setting up the database correctly to start with on my local machine. e.g. set it up in latin1 rather UTF to begin with? If so, which aspects should I change specifically and should I expect other problems as a result?
Many thanks for your input.
jakob
Last edited by jakob (2005-10-23 08:40:52)
TXP Builders – finely-crafted code, design and txp
Offline
Re: workflow suggestions for retaining foreign characters
My advice would be to simply install mysql4.0 (or whatever your target version is) in parallel on your local workstation and run it on a different port.
Otherwise you can try ( untested! ) opening textpattern/setup/index.php and around line 36 find:
<code>
// On 4.1 or greater use utf8-tables
$version = mysql_get_server_info();
if ( intval($version0) >= 5 || preg_match(‘#^4\.[1-9]#’,$version))
{
if (mysql_query(“SET NAMES utf8”))
{
$carry[‘dbcharset’] = “utf8”;
$carry[‘dbcollate’] = “utf8_general_ci”;
} else $carry[‘dbcharset’] = “latin1”;
} else $carry[‘dbcharset’] = “latin1”;
</code>
and replace that with:
<code>
// On 4.1 or greater use utf8-tables
$version = mysql_get_server_info();
$carry[‘dbcharset’] = “latin1”;
</code>
And then do a clean install.
Offline
Re: workflow suggestions for retaining foreign characters
Couldn’t he simply switch the charset used (in the db chit-chat things) in his config file ?
Offline
Re: workflow suggestions for retaining foreign characters
Installation doesn’t use the values from the config-file, it uses the information that was discovered and is being passed along via POST.
Offline
#5 2005-10-24 00:10:59
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: workflow suggestions for retaining foreign characters
Maybe this problem is now resolved in Textpattern 4.01, maybe not?
Unfortunately, it’s not really something we can resolve. MySQL have moved the character set goalposts several times now, and some PHP bugs and omissions have further complicated things. There appears to be no clean way to migrate a database through different versions of MySQL, without risking character set issues. That’s a problem of MySQL’s making, not ours. We’ve done our best (by “we” I mean “Sencer” :) to smooth out the problems, but it’s a bloody mess that’s probably impossible to solve completely.
In short: moving data from MySQL 4.0 to 4.1 (whether between matchines, or during a MySQL upgrade) will often screw things up, and there’s not a lot we can do about it.
Alex
Offline
Re: workflow suggestions for retaining foreign characters
Thanks for the feeback, clear explanation and the tip. I’ll give it a go and see if it works. Otherwise you seem to suggest, that altering my XAMPP setup to reflect the (respective) server situation is likely to be the best guarantee for compatability.
TXP Builders – finely-crafted code, design and txp
Offline