Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 10:21:51 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Setting WB to UTF8  (Read 520 times)
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« on: January 06, 2012, 05:39:59 PM »

Hello,

i start this thread in the hope that we will end in a working howto convert all WB installations on different server configurations completely to UTF8.

There are different places where you can find UTF8:

1.) The Database Collation
2.) The Database Characterset
3.) The Head-informations of your Template

My goal is to convert all of them to UTF8 and have in the result my pages displayed correctly without wrong characters in the frontend. This means:

1.) Database Collation of all tables and the text- and char-fields have :  utf8_unicode_ci
2.) The Database Characterset is then: utf8
3.) The content of the database is in the way, that it is displayed correct
4.) The charset in advanced WB-Settings is then: Unicode (utf-8)

In most cases the collation of your server is set to "latin1_swedish_ci" and the characterset to "latin1" and in WB the charset to "Unicode (utf-8)" or sometimes in germany to "Iso-8859-1".

I've done the following Steps.
1.) Make a backup of the database
2.) Convert the Content of the database
3.) Change the collation and the characterset of the database
4.) Change charset of WB

1.) Make a backup of the database
Use phpmyadmin to export your database to a .sql file on your local machine

2.) Convert the Content of the database (only needed if your WB-charset is not "Unicode utf-8")
- Make a copy of your database export
- Open this file with a editor (e.g. Notepad++)
- Store this file in "ANSI"
- convert the file to "UTF8 without BOM"
- import the file to your database on the server

3.) Change the collation and the characterset of the database
- rename the attached file from .txt to .php
- adapt the file to the settings for your database (Line 24-27)
Code:
$mysqlserver = 'localhost' ;     //Host
$mysqluser = 'User';              //User
$mysqlpw = 'Password';         //Password
$mysqldb = 'Database';          //Database
- upload this file to the root of your server
- Call the sript in your browser: http://www.your.domain.com/mysql_change_collation.php
- Delete the script from your server

4.) Change charset of WB (only needed it is not set to "Unicode utf-8")
- go to advanced setting of WB and change the charset to "Unicode (utf-8)"

Now your done and your site should work as before without wrong characters in the frontend.

Disadvantages
WB 2.8.x does not use "set names" to store in the database. This means that all special chars (e.g. "ü") are stored in the database as "ü", but all WB-script can handle this.

In the hope of a good discussion and maybe other better ideas

Matthias
« Last Edit: January 06, 2012, 05:59:16 PM by ruebenwurzel » Logged
jdjdjd

Offline Offline

Posts: 21


« Reply #1 on: January 08, 2012, 12:35:02 PM »

I use a news to RSS feed on a number of my sites and often have problems with feeds invalidating with certain characters, usually when a client pastes things like quotation marks etc from a word document. Could converting to UTF8 potentially fix this problem?

Also many thanks for the guide.
« Last Edit: January 08, 2012, 12:36:36 PM by jdjdjd » Logged
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #2 on: January 08, 2012, 01:53:28 PM »

Good post, I'll make it a sticky one.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
noname8

Offline Offline

Posts: 75


« Reply #3 on: April 02, 2012, 06:34:49 AM »

Good topic but this gives errors. Most of the server sql admin is used with phpmyadmin and it just cannot show the standard wb database right. I mean that somehow the phpmyadmin is showing the chars incorrectly.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!