このページでは

テキストエンコーディングの変更

編集モードツールバー

Edit モードで現在のファイルのファイルエンコーディングをエディタツールバー (4) に表示するには、Preferences>Text Editor >Display >Display file encoding に進みます。

テキストエディタ環境設定の「表示」タブ

テキストエンコーディングを変更するには、ツールバーでそれを選択し、Text Encoding ダイアログで新しいエンコーディングを選択します:

テキストエンコーディングダイアログ

選択したエンコーディングでファイルを再読み込みするには、Reload with Encoding を選択します。

新しいエンコーディングでファイルを保存するには、Save with Encoding

デフォルトエンコーディングの設定

デフォルトのファイルエンコーディングを定義するには、Preferences>Text Editor >Behavior を選択し、Default encoding で適切なオプションを選択します。

テキストエディタ環境設定の「動作」タブにあるファイルエンコーディング

Qt は UTF-8 でエンコードされたソースファイルを必要とするため、デフォルトのエンコーディングはUTF-8 に設定されています。

UTF-8 エンコードされていないファイルを編集しようとすると、次のようなエラーメッセージが表示されます:Error: Could not decode "filename" with "UTF-8"-encoding. Editing not possible.

この問題を解決するには、ファイル変換ツールを使用してファイルのエンコードをUTF-8に変換してください。そうしないと、文字列定数のQString への変換が期待通りに動作しない可能性があります。

Qt アプリケーションを開発しない場合は、他のエンコーディング・オプションをデフォルト・エンコーディ ングとして設定することができます。システムで使用されているファイル・エンコーディングを使用するには、System オプションを選択します。

コードの編集」、「編集モード」、「動作」も参照してください

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.