User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:upgrade_to_utf8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mantisbt:upgrade_to_utf8 [2007/09/21 02:48] giallumantisbt:upgrade_to_utf8 [2013/06/10 12:18] (current) atrol
Line 143: Line 143:
 Feel free to add your own or comment about the results if you use one of them to perform the upgrade: Feel free to add your own or comment about the results if you use one of them to perform the upgrade:
  
 +  * http://www.phpwact.org/php/i18n/charsets - Really useful document on the issue
   * [[http://textsnippets.com/posts/show/84|Convert a db to UTF8 after upgrading to MySQL 4.1]] - 4 steps procedure   * [[http://textsnippets.com/posts/show/84|Convert a db to UTF8 after upgrading to MySQL 4.1]] - 4 steps procedure
   * http://dev.mysql.com/tech-resources/articles/4.1/unicode.html   * http://dev.mysql.com/tech-resources/articles/4.1/unicode.html
 +  * http://dev.mysql.com/doc/refman/4.1/en/charset-conversion.html
   * [[http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html|Turning MySQL data in latin1 to utf-8]] - very detailed howto complete with troubleshooting steps   * [[http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html|Turning MySQL data in latin1 to utf-8]] - very detailed howto complete with troubleshooting steps
 +  * [[http://www.w3.org/International/questions/qa-forms-utf-8.en.php|Perl regexp to test a string for UTF-8 encoding]]
 +  * [[http://www.herongyang.com/PHP-Chinese/PHP-MySQL-Character-Set-on-Text-Columns.html]]
 +
 +====== Enable CJK Text Entering ======
 +
 +**additional notes by tomyjwu**
 +
 +===== Introduction =====
 +
 +This hack and experience is done in ubuntu 8.04 with 
 +  * mantis 1.1.2+dfsg-8~hardy1
 +  * mysql 5.0.51a-3ubuntu5.4
 +
 +The goal is to enable CJK text input on mantis bug descriptions and notes. Two issues must be resolved:
 +
 +  * Mantis database must store descriptions in utf8 by default
 +  * Mantis communicates with mySQL using utf8 way, according to the book by herongyang
 + 
 +Please check the Web resources section for the book URL.
 +
 +===== Enable utf8 communications =====
 +  * Edit the config file /etc/mysql/my.cnf
 +    * add to both server and client section the default encoding 
 +   <code>
 +   [client]
 +   default-character-set=utf8
 +
 +   [mysqld]
 +   default-character-set=utf8
 +   </code>
 +  * check setting in mysql command line (mysql -u root -p)
 +    * <code> SHOW VARIABLES LIKE 'character_set_%';</code>
 +
 +===== Upgrade the mantis database =====
 +  * Upgrade 3 levels according to the book by herongyang about mySQL and php.
 +    * Manage mantis database by issuing following commands in mysql command line <code>mysql -u root -p mantis </code>
 +    * database level
 +      * altering commands <code>alter database mantis character set utf8;</code>
 +      * verify by <code>SHOW CREATE DATABASE mantis;</code>
 +    * table and column level on mantis_bug_text_table and mantis_bugnote_text_table
 +      * altering commands <code>
 +       alter table mantis_bug_text_table default character set utf8;
 +       alter table mantis_bug_text_table convert to character set utf8;
 +       alter table mantis_bugnote_text_table default character set utf8;
 +       alter table mantis_bugnote_text_table convert to character set utf8;</code>
 +      * verify by <code>
 +       SHOW CREATE TABLE mantis_bug_text_table; 
 +       SHOW CREATE TABLE mantis_bugnote_text_table; </code>
 +
 +===== Results =====
 + Now you could add a new bug entry in the mantis using web interface and preserve the entered CJK text in utf8 format. Resulted entries are displayed correctly in web browser. Tested with Firefox browser.
 +
  
  
  
mantisbt/upgrade_to_utf8.1190357333.txt.gz · Last modified: 2008/10/29 04:31 (external edit)

CC Attribution-Noncommercial-Share Alike 4.0 International Driven by DokuWiki