Форумы / Cotonti / Patches / Migration from Seditio 121/125 to Cotonti 0.0.2


#16 04.02.2009 06:09
1. So do I have to convert my database in UTF-8? I'm worring about the missing of italians characters...

1. Also here on cotonti.com automatic refresh doesn't go well... it's disabled or you're having the same problem as me?
in [color=#729FCF][b]BLUES[/b][/color] I trust
#17 04.02.2009 06:47
I think you could try contacting your hosting support, probably they can do something on default encoding of webserver output. I don't really want to force everybody moving to utf-8.

Autorefresh is disabled here. But I don't exclude the possibility of bugged autorefresh in current markItUp! version if you say so. Just needs a bit testing on localhost.
May the Source be with you!
#18 04.02.2009 08:25
I've tried markitup in localhost and online, with the latest version from author's website... problems remain... strange characters (also in local, where I can set what I want) and no autorefresh in preview...

P.S. I'm doing Italian translation of main.lang and other lang files... I hope it will be usefull and nobody was already doing that...
in [color=#729FCF][b]BLUES[/b][/color] I trust
#19 04.02.2009 15:17
The translation would be great, thanks.
May the Source be with you!
#20 05.02.2009 03:58
Ok, I'll do my best to complete the work quickly :-) ...but I'm still waiting for a solution to my charset problem :-(
in [color=#729FCF][b]BLUES[/b][/color] I trust
#21 05.02.2009 04:12
Basically, mixing charsets is a very bad idea. So you have to decide using one charset and converting everything into it.
May the Source be with you!
#22 05.02.2009 04:59
So are you saying that if I'll set charset and collation in database to ISO-8859-1 (leaving untouched the datas that would be inserted in that charset by Server in these two years) and also headers in webpages to ISO-8859-1 all would go well?

But some posts ago you told me:
You see AJAX uses UTF-8 by default, that's why previews are often messed. But sending correct header() with exact charset usually fixes the problem

I'm confused... :-O
in [color=#729FCF][b]BLUES[/b][/color] I trust
#23 05.02.2009 13:21
Cotonti sql-updater gives me an error and fails to work

After I follow the other steps I get a site that looks like this cotoni site! but after I log in, the skin of my site changes back to my old skin. When I goto my profile to change it back to SED-LIGHT i get an error, this also happens when I try to edit or create new things
2009-02-05 20:11
Fatal error : Wrong parameter in the URL
And if i try to access the Admin I just get a blank white page
Отредактировано: musashi9 (06.02.2009 09:33, 14 лет назад)
#24 06.02.2009 14:18
donP, be careful. What you said should work if all your existing data is in ISO-8859-1. But mixing charsets would be quite dangerous.

Generally we recommend moving to UTF-8 to add multilingual support. But in the end that is personal choice.

musashi9, any details on your server? OS, MySQL and PHP version would be helpful.
May the Source be with you!
#25 06.02.2009 16:59
my Admin page now works after deleting all the system php files and re uploading them
but i still can't click submit on anything without getting that fatal error.

details from my host

Type Debian

MySQL Version
MySQL Version 5.0.45

Perl Version
Perl 5.8.8

PHP Version
PHP 5.2.2

I also noticed that on my pages with downloads. The download button says "THIS DOWNLOAD IS ONLY AVAILABLE TO REGISTERED MEMBERS", even though I am logged in as Admin
Отредактировано: musashi9 (07.02.2009 08:02, 14 лет назад)
#26 06.02.2009 20:37
Now I strangely solved the problem setting-up UTF-8 only for markitup prevew, like this:
in markitup.ajax.php
header('Content-type: text/html; charset=UTF-8');
instead of the default
header('Content-type: text/html; charset='.$cfg['charset']);

So, now I have my website headers declaration set to ISO-8859-1, my MySql database with collation and charser set to unicode-utf8-ci, my database datas (I think) inserted with ISO-8859-1 format... :-/ but all seems to go well :-O

The refresh problem has caused by an error (I think) in markitup.setup.php:

Instead of
autorefresh=01:radio::0 preview auto-refresh
I put
autorefresh=01:select:true,false:false:Enable preview auto-refresh

Now, it seems to be in order...
in [color=#729FCF][b]BLUES[/b][/color] I trust
Отредактировано: donP (06.02.2009 21:48, 14 лет назад)
#27 11.03.2009 05:03
is there a dutch language already? or can i use my dutch seditio language

here a script to convert your databse to UTF8

<title>Convert MySQL Database to UTF-8</title>

// Fill in your configuration below
$db_server      = 'localhost';
$db_user      = '';
$db_password   = '';
$db_name      = '';

// Do not change anything below this

$connection = mysql_connect($db_server, $db_user, $db_password) or die( mysql_error() );
$db = mysql_select_db($db_name) or die( mysql_error() );

$sql = 'SHOW TABLES';
if ( !($result = mysql_query($sql)) )
   print '<span style="color: red;">SQL Error: <br>' . mysql_error() . "</span>\n";

// Loop through all tables in this database
while ( $row = mysql_fetch_row($result) )
   $table = mysql_real_escape_string($row[0]);
   $sql2 = "ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";
   if ( !($result2 = mysql_query($sql2)) )
      print '<span style="color: red;">SQL Error: <br>' . mysql_error() . "</span>\n";
   print "$table changed to UTF-8 successfully.<br>\n";

   // Now loop through all the fields within this table
   $sql3 = "SHOW COLUMNS FROM $table";
   if ( !($result3 = mysql_query($sql3)) )
      print '<span style="color: red;">SQL Error: <br>' . mysql_error() . "</span>\n";

   while ( $row3 = mysql_fetch_row($result3) )
      $field_name = $row3[0];
      $field_type = $row3[1];
      // Change text based fields
      $skipped_field_types = array('char', 'text', 'blob', 'enum', 'set');
      foreach ( $skipped_field_types as $type )
         if ( strpos($field_type, $type) !== false )
            $sql4 = "ALTER TABLE $table CHANGE `$field_name` `$field_name` $field_type CHARACTER SET utf8 COLLATE utf8_bin";
            if ( !($result4 = mysql_query($sql4)) )
               print '<span style="color: red;">SQL Error: <br>' . mysql_error() . "</span>\n";
               break 3;
            print "---- $field_name changed to UTF-8 successfully.<br>\n";
   print "<hr>\n";


#28 13.03.2009 02:42
I presume this also will work on the 0.0.3 release?
#29 13.03.2009 03:08
With one extra sql that needs to be imported - 002-003.sql

Will be making a tutorial on encoding in case your database needs this (most do), as well as upgrading. Soon.
<a href="http://www.domenlo.com">Surreal Art</a>
#30 13.03.2009 04:35
ok, thx Lombi.. I'll wait for that then...