Joomla! International
Welcome, Guest
Please Login or Register.
Lost Password?
does not display non-English content correctly (1 viewing)
_GEN_GOTOBOTTOM Post Reply Favoured: 0
TOPIC: does not display non-English content correctly
#45
does not display non-English content correctly 2008/04/11 20:44  
I installed JIE, base installation (MySQl database is also set to UTF-8 as required), but I can no display both English and Cyrillic language in one page, it does not display non-English content correctly, just show ??? ????, ????????, ????? ????????????????? ???????. What is wrong?
  The administrator has disabled public write access.
#46
Re:does not display non-English content correctly 2008/04/19 16:20  
Since UTF-8 encoding not work for me, i want set Cyrillic Character Set for all website
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
Where to set this in Joomla?
  The administrator has disabled public write access.
#47
Re:does not display non-English content correctly 2008/04/27 08:42  
Check out the (yourlanguage).php file in the languages directory, on line 435 or so the setting is defined in
define('_ISO', 'your character set here');

You may also want to check your database encodings.
  The administrator has disabled public write access.
#48
Re:does not display non-English content correctly 2008/04/27 19:53  
Finally, I solved this problem. Problem was in MySQL database.
I use Byethost shared hosting, it have PHPMyAdmin problem: is simply does not work(disabled?). The database is created from other place, not from PHPMyAdmin, and it not possible set database collation from PHPMyAdmin. I checked my database structure and found that all tables Collation was latin1_swedish_ci. Therefore, the only possible way is to alter database to utf-8 collation. I found PHP script
that change all fields/tables to a different collation and run it against my database and this has helped.
Code:

  <?php // this script will output the queries need to change all fields/tables to a different collation // it is HIGHLY suggested you take a MySQL dump prior to running any of the generated // this code is provided as is and without any warranty die("Make a backup of your MySQL database then remove this line"); set_time_limit(0); // collation you want to change: $convert_from 'latin1_swedish_ci'; // collation you want to change it to: $convert_to 'utf8_general_ci'; // character set of new collation: $character_set'utf8'; $show_alter_table true; $show_alter_field true; // DB login information $username 'user'; $password 'pass'; $database 'table'; $host 'localhost'; mysql_connect($host$username$password); mysql_select_db($database); $rs_tables mysql_query(" SHOW TABLES ") or die(mysql_error()); print '<pre>'; while ($row_tables mysql_fetch_row($rs_tables)) { $table mysql_real_escape_string($row_tables[0]); // Alter table collation // ALTER TABLE `account` DEFAULT CHARACTER SET utf8 if ($show_alter_table) echo("ALTER TABLE `$table` DEFAULT CHARACTER SET $character_set;\r\n"); $rs mysql_query(" SHOW FULL FIELDS FROM `$table` ") or die(mysql_error()); while ($row=mysql_fetch_assoc($rs)) { if ($row['Collation']!=$convert_from) continue; // Is the field allowed to be null? if ($row['Null']=='YES') $nullable ' NULL '; else $nullable ' NOT NULL'; // Does the field default to null, a string, or nothing? if ($row['Default']==NULL) $default " DEFAULT NULL"; else if ($row['Default']!='') $default " DEFAULT '".mysql_real_escape_string($row['Default'])."'"; else $default ''; // Alter field collation: // ALTER TABLE `tab` CHANGE `fiel` `fiel` CHAR( 5 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL  DEFAULT NULL if ($show_alter_field) { $field mysql_real_escape_string($row['Field']); echo "ALTER TABLE `$table` CHANGE `$field` `$field` $row[Type] CHARACTER SET $character_set COLLATE  $convert_to $nullable $default; \r\n"; } } } ?>



I am not assured though, that I did all correctly, but it has helped.
Those who use this Byethost shared hosting, can have the same problems.

Here is another code:

Code:

 ALTER DATABASE `db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;



What is correct to alter database to UTF-8?
  The administrator has disabled public write access.
#52
Re:does not display non-English content correctly 2008/06/16 22:44  
where should i put this code?

and can you give me example to change this

$database = 'table';
$host = 'localhost';

???
  The administrator has disabled public write access.
#55
Re:does not display non-English content correctly 2008/06/27 19:03  
You need set MySQL database to UTF-8 before installing Joomla.
This done via phpMyAdmin, Database Manager.
If you already Jommla and found that your database default collation is latin1_swedish_ci collation(for example), then you need alter database to utf-8 collation.

Open your Database Manager, select "SQL", this will open a text field, paste this query text into the box, click "Go".

Code:

 ALTER DATABASE `db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;


Replace 'db_name' with your mysql database name.
Once it worked, it will bring you back to the same page and should confirm if all went well, something like "Your SQL-query has been executed successfully".

You need also change all fields/tables in your database to utf8 collation.
For this purpose you can run the aboved PHP script, put this script in your web directory and run from browser.
Note that you need first specify your data here:

$username = 'user';
$password = 'pass';
$database = 'table';
$host = 'localhost';

Also, comment this line, like this:

//die("Make a backup of your MySQL database then remove this line");
  The administrator has disabled public write access.
_GEN_GOTOTOP Post Reply
get the latest posts directly to your desktop