What is Joom!Fish?

The Joom!Fish is your key for providing multilingual content to your visitors! International (i8n) portals, companies or projects require content in different languages and processes which help to keep track of the translations. The Joom!Fish extension for the CMS Joomla! does exactly this.
Read more

Become a Club Member

You are interested in PDF documentation of Joom!Fish core extension or some special plugins and extensions? The you should think about becoming a Joom!Fish Club Member. These exclusive benefits are only available for Club Members help to extend your Joom!Fish experience and enables you to provide better support for your clients.

join now

Home Downloads How to ... Joom!Fish, encodings and UTF-8
Joom!Fish, encodings and UTF-8
Monday, 28 May 2007 02:41

This article relates to Joomfish 1.8 and Joomla 1.0 and is not relevant to Joomfish 2.0 on Joomla 1.5.

Due to the many questions in the last weeks, I will try to summarize some issues with encoding on multilanguage sites with 1.0 series.
Basically, bilanguage sites, where one of the languages is English do not have problems with encoding, but if you experience such, I would highly advise you to put the Non-English language as default. This will allow you to run your Joomla! Backend on that language and in most of the cases, this solves 99% of the encoding problems and database missmatches in collations. If you still experience problems with the encoding of the other language, this is caused almost in all of the cases by the apache (or other server) default encoding, that is preset. On some servers, this encoding is sent as a header in the cookie and causes issues. In such case, there is easy and fast solution:

- Open the file globals.php and at the end of it, right after the last

Code:
}
and right before
Code:
?>
put the following code:
Code:
header("Content-Type: text/html; charset=ENCODING");
where ENCODING should be replaced by the encoding used for the language that is not English. Example (Windows Cyrillic):
Code:
header("Content-Type: text/html; charset=windows-1251");

While with bilingual sites it is more or less easy and problemless, when it happens that you need to build a web site in three languages or even in two languages, where these use different charsets and none of them is English, I would highly recommend you to consider a fully UTF-8 web site.

How to do it?
Please do these actions, before installing Joomla!
1. Create your database manually and go to operations, there set a collation of the database as utf8_general_ci.
2. Open the file includes/database.php go to line 102 and change the following code from:
Code:
//        @mysql_query("SET NAMES 'utf8'", $this->_resource);
to:
Code:
        @mysql_query("SET NAMES 'utf8'", $this->_resource);

Screenshots:

{gallery}screenshots{/gallery}

Now save the file.
3. Open the file globals.php and at the end of it, right after the last

Code:
}
and right before
Code:
?>
put the following code:
Code:
header("Content-Type: text/html; charset=UTF-8");

4. Open the file language/english.php and go on line 421. Change the following code from:

Code:
DEFINE('_ISO','charset=iso-8859-1');
to:
Code:
DEFINE('_ISO','charset=UTF-8');

5. Upload Joomla! and install Joomla! in the normal way.
6. When you install new languages, please be sure that those are saved as UTF-8 without BOM. Very cool editors that allow this are Crimson Editor and Notepad++

That's it. Now everything is expected to work like a charm. More information about how Joomla! 1.0.x handles UTF-8 is available in the following post:
http://forum.joomla.org/index.php/topic,55065.0.html
You can also consider to use the hack that allows generation of PDF documents in UTF and works for probably any language:
http://forum.joomla.org/index.php/topic,110713.0.html

Author note:
Older versions of MySQL doesn't supports databases with collation utf8_general_ci, then you most probably would not be able to create a fully compatible UTF-8 site.

Last Updated on Saturday, 04 October 2008 12:22
 

0 Comments

Add Comment

 
joomfish_2.0_download

Core Extension Feedback

Joomla!Code powered

joomlacode.orgThe Joom!Fish development is based on the resources provided by the Joomla! project. Specially the JoomlaCode.org website provides us with a great tool to work on the extension. Thanks for that!