|
"useUnicode=true" を JDBC URL に追加します。
jdbc:mysql://hostname:port/database?useUnicode=true&characterEncoding=utf8 |
If you are modifying
|
Create a UTF-8 database with binary UTF-8 collation.
Binary UTF-8 provides case-sensitive collation.
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin; |
You will also need to set the Server Characterset to utf8. This can be done by adding the following in my.ini for Windows or my.cnf for other OS. It has to be declared in the Server section, which is the section after [mysqld]:
[mysqld] default-character-set=utf8 |
status command to verify database character encoding information. ![Confluence 4.0 > Configuring Database Character Encoding > mysql-database-creation-and-status-check-via-console.png (mysql-database-creation-and-status-check-via-console.png [Screenshot of MySQL Console screen showing database creation and status check commands with encoding highlighted.])](https://confluence.atlassian.com/download/attachments/269985489/mysql-database-creation-and-status-check-via-console.png?version=1&modificationDate=1247635701761&api=v2)
場合によっては、 個々の表の照合順序および文字エンコーディングは、使用するために設定された全体としてのデータベースのものと異なることがあります。以下のコマンドを使用して、Confluence データベース内のすべての表が UTF-8 文字エンコーディングとバイナリ UTF-8 照合順序を使用するように正しく設定されていることを確認してください。
use confluence; show table status; |
Check for the value listed under the Collation column, to ensure it has been set to utf8_bin (that is, case-sensitive) collation for all tables.
If not, then this can be changed by the following command, executed for each table in the Confluence database:
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; |
上記の <tablename> を Confluence データベース内の各表に置き換えてください。
より詳細な説明については、次の関連 MySQL マニュアルを参照してください。
CREATE DATABASE confluence WITH ENCODING 'UNICODE'; |
またはコマンドラインから
$ createdb -E UNICODE confluence |
For more information see the PostgreSQL documentation.
国際文字セットは、Microsoft Windows で PostgreSQL 8.1 以上を使用している場合にのみ完全にサポートされ、機能するので注意が必要です。
データベース内の国際文字が適切に処理されるように、次のことを必ず確認してください。 |
When PostgreSQL creates an initial database cluster, it sets certain important configuration options based on the host enviroment. The command responsible for creating the PostgreSQL environment initdb will check environment variables such as LC_CTYPE and LC_COLLATE (or the more general LC_ALL) for settings to use as database defaults related to international string handling. As such it is important to make sure that your PostgreSQL environment is configured correctly before you install Confluence.
To do this, connect to your PostgreSQL instance using pgsql and issue the following command:
SHOW LC_CTYPE; |
If LC_CTYPE is set to either "C" or "POSIX" then certain string functions such as converting to and from upper and lower case will not work correctly with international characters. Correct settings for this value take the form <LOCALE>.<ENCODING> (en_AU.UTF8 for example).
If your LC_CTYPE is incorrect please check the PostgreSQL documentation for information on configuring database localisation. It is not easy to change these settings with a database that already contains data.
既存のデータベースを使用している場合、次のクエリを実行することで、文字エンコードを確認します。 |
以降の変更に進む前に、データベースをバックアップしてください。 |
This example shows how to change your database from latin1 to utf8.
mysqldump -p --default_character-set=latin1 -u <username> --skip-set-charset confluence > confluence_database.sqlconfluence_database.sql to confluence_utf8.sqlconfluence_utf8.sql in a text editor and change all character sets from 'latin1' to 'utf8'recode latin1..utf8 confluence_utf8.sql (the recode utility is described at http://directory.fsf.org/recode.html; it can actually be downloaded from http://recode.progiciels-bpi.ca/, and is available for Ubuntu via apt-get)MySQL の場合:
DROP DATABASE confluence;CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;Finally, reimport the UTF-8 text file:
mysql -u <username> -p --default-character-set=utf8 --max_allowed_packet=64M confluence < /home/confluence/confluence_utf8.sql大容量のインポートをサポートするために、上記で使用されたパラメーター '--max_allowed_packet=64M' が SQL 文の最大サイズを非常に大きな値に設定します。状況によっては、特に、添付ファイルがデータベースに保存されている場合など、さらに値を大きくする必要がある場合もあります。
See Troubleshooting Character Encodings for a number of tests you can run to ensure your database encoding is correct.
Character encodings in Confluence
Database Troubleshooting for MySQL