Contribute  :  Support  :  Downloads  :  Forum  :  Links  :  Polls  :  Calendar  :  Directory  :  Advanced Search  
Geeklog The Ultimate Weblog System
Welcome to Geeklog
Friday, May 16 2008 @ 03:11 AM EDT
   

How to convert your Geeklog to Unicode/UTF-8 in 11 steps.

GeeklogIf you started your server with one language, and want to move to a multilanguage system later on, it can be quite difficult if you need different charachter sets for the different languages. With UTF-8 you can display all langauges and letters at the same time in the same page without any problems.
The best solution therefore would be to convert your _complete_ data into Unicode in one go. You dont want to go through each story and comment and edit letters by hand after you switched the encoding of the page.

For this procedure to work you need (1) a text editor like notepad that can save raw text data while choosing the encoding (Notepad unter windows for example), (2) direct access to you MySQL executable (Windows cmd or Linux Shell) and (3) a NON-Unicode-Capable Editor (!) such as PHPEdit (or linux shell editors AFAIK). You can find out which editor cannot handle Unicode by saving a small text containing a "xxöxx" or similar with notepad as UTF-8 (See step 3) and opening it with the other editor. If you the letter "ö" appears now as "ö" you have the right one.

Now let's start.

1. Make a Backup of your database using the Geeklog Backup function.

2. Download the created file from your server, zip it, burn it on a CD and send it to your lawyer. He should keep it as a backup in case you need it later to go back to step one.

3. Open the file in Notepad/unicode-able editor (Notepad.exe). If your database is large, this will take some time, but its worth waiting for. Save the file again under a different (!) filename. Before you press the save-button, you have a field called "Encoding" below the field where you entered the filename. Choose "UTF-8".

4. Now open the file in the non-Unicode-capable editor. You will see three strange letters "" in the beginning of the file. Remove them. They cause error-messages in the SQL later. Save the file again.

5. Upload the file to your server. You might want to zip it first (also before downloading) to reduce transfer time.

6. Create a new database if you can. If not delete all tables from your old one (call your lawyer to have your backup ready in an envelope).

7. Write the data back into the database. Do this by typing

mysql --user=root --password databasename file.txt

replace "databasename" with the name of the newly created or emtpy database, and file.txt with the name of the file that you saved with notepad. The file has to be in the same directory as you are, if not move the file there. In Windows, it has to be in the /Mysql/bin-directory, where your MySQL.exe resides. If you do not want to move the files, prepend the path to the mysql.exe and/or the filename path.

If you do not have root access to the database, exchange "root" with the username that you use to access your MySQL server.

8. Hit enter. You will be prompted for the user's password. Enter it, and press return again. Now the database will be parsed back into the server.

9. If you created a second database, edit your geeklog's config.php so that it accesses the new one.

10. Switch your geeklog language to one of the _UTF-8 sets. If you want to reduce hassle with your users that have been using non-UTF-8 languages, convert all the language-files you have to UTF-8 with notepad (You dont need to remove the first three letter there) and change the encoding string in each file (Line 30) to
$LANG_CHARSET = "utf-8";

11. Change config.php so that the standard language file will be one of the UTF-8 sets also (somehwere line 239),
$_CONF['language']="english_UTF-8";

12. You might want to delete all non-utf-8 languages from your language folders.

Thats all. Good luck :-)

Story Options

How to convert your Geeklog to Unicode/UTF-8 in 11 steps. | 7 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: Anonymous on Wednesday, October 13 2004 @ 02:59 PM EDT
I also uploaded a pack of the language files, all converted to UTF-8. Please get them here. The german non-formal is missing however - my mistake. Still, this file is also in the standard distribution as UTF-8 Format.

---
tokyoahead.com

How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: bellagiohosting on Wednesday, October 20 2004 @ 09:12 PM EDT
Thanks for the 11 step program please keep posting on any updates

mike@global-advanced-media.com
www.global-advanced-media.com
How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: Anonymous on Wednesday, October 27 2004 @ 03:40 AM EDT
I will. Hoever this is a general concept that applies to any database that runs on MySQL. I am not sure if anything will change on that in the future. I will make sure however that we will have all language files in UTF available. To be honest I dont really understand why people use something else than UTF-8. Are there that many systems that cannot handle UTF-8 yet?

---
tokyoahead.com
How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: sakata on Thursday, November 04 2004 @ 06:07 PM EST
Thanks. They are very kind instructions.

I have translated your article into Japanese and uploaded it on my
server.
I am not sure if UTF-8 works good in Japanese though.
(Some user report problems.)
I will check it out anyway.
How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: Anonymous on Friday, November 05 2004 @ 01:08 AM EST
Strange. I am running a complete Kanji Dictionary with it. Not one problem (That I know of :-)

---
tokyoahead.com
How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: sakata on Friday, November 05 2004 @ 01:48 AM EST
Well, I have converted my site into UTF-8.
As far as I have tested, there are no problem.

Anyway, I haven't found any 3 strange letters on top of the sql text.

Umm, I will consider changing Geeklog Japanese page into UTF-8 in a
few days!
How to convert your Geeklog to Unicode/UTF-8 in 11 steps.
Authored by: Anonymous on Friday, November 05 2004 @ 06:52 AM EST
Great that it worked!!
Anyhow if you did not find those letters, its ok. If you find them, the SQL wont work. If they are not there, no problems of course :-)


---
tokyoahead.com