negarkhane wrote:
Dear info graf
i found new error in save data into mysql 5.0.x , when i set my encoding utf-8 in our page the data was sucsess add to data base but when i do edit the data in mysql with phpmyadmin 2.6 all data is not set and charcter have an eror .
the data when save into data base use latin1_general_ci not utf8_persian_ci.
could you tell me :'(
I am assuming that you are referring to utf-8 in Joomla 1.0.x
The issue is quite simple - Joomla 1.0.x does not support any multibyte character encodings such as utf-8. This support will come in version 1.1.
However, one can configure Joomla 1.0.x in a reasonable way to support utf-8. The database needs to be made utf-8 compliant. Existing data needs to be converted to utf-8. Connection to the database needs to be encoded utf-8. Language files need to be converted to utf-8. Even after all this most of the components are not utf-8 compliant and php string functions are not utf-8 compliant which could cause some artifacts and logical errors.
A quick guideline to getting Joomla 1.0.x to work with utf-8 is as follows:
- use MySQL version 4.1.2 or newer (older versions don't support utf-8).
- create an empty database manually before installing Joomla. Set the character set to utf8 with some collation (utf8_general_ci is the default and should be OK. If a specific utf8 collation exists - it can be used).
- convert the language files to utf-8 (all language files including for editors, components etc.)
- Install Joomla using the pre-existing database
- set 'charset=utf-8' in the _ISO define in the language file
- You should uncomment one line of code in the includes/database.php file at about line 102 (second line below)
Code:
$this->_table_prefix = $table_prefix;
//@mysql_query("SET NAMES 'utf8'", $this->_resource); // THIS IS THE LINE TO UNCOMMENT
$this->_ticker = 0;
$this->_log = array();
Please note that the above does not make Joomla 1.0.x fully utf-8 compatible. All string functions will still be using singlebyte character functions. This works well in most cases. There could be some instances of garbage characters especially with diacritic Latin characters.