「文字コード」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(リンクを修正)
25行目: 25行目:
   
 
これらのアプリケーションは、UTF-8 ロケールから起動する必要があります。そうでないと UTF-8 サポートがなくなります。上記の指示に従って {{ic|en_US.UTF-8}} ロケール(またはお使いのローカルの UTF-8 代替)を有効にし、デフォルトのロケールに設定した後、再起動してください。
 
これらのアプリケーションは、UTF-8 ロケールから起動する必要があります。そうでないと UTF-8 サポートがなくなります。上記の指示に従って {{ic|en_US.UTF-8}} ロケール(またはお使いのローカルの UTF-8 代替)を有効にし、デフォルトのロケールに設定した後、再起動してください。
  +
  +
== URL encoding ==
  +
  +
URIs accept US-ASCII characters only and use [[Wikipedia:percent-encoding|percent-encoding]] to encode non-ASCII characters. This can result in very long and human-unreadable URIs.
  +
  +
In Firefox, it is possible to copy decoded URLs by enabling the {{ic|browser.urlbar.decodeURLsOnCopy}} flag in {{ic|about:config}}, or by inserting a space to the start of the URL, then selecting it (with the space) and copying it. However, this trick doesn't work on Chromium, and there is no equivalent flag. Alternatively, select starting at the end of the URL until right after the {{ic|https://}} part, then copy.
  +
  +
For command line usage, you can use {{pkg|python-urllib3}} to translate encoded URLs from stdin.
  +
  +
$ python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read().strip()))"
   
 
== トラブルシューティング ==
 
== トラブルシューティング ==

2024年8月16日 (金) 23:25時点における版

関連記事

文字コードは、バイトを読み取り可能な文字に解釈するプロセスです。UTF-8 は 2009 年以降主要なエンコーディングとなっており、事実上の標準として推進されています[1]

UTF-8

ターミナル

以下は UTF-8 をサポートするいくつかのターミナルのリストです。

Gnome-terminal または rxvt-unicode

これらのアプリケーションは、UTF-8 ロケールから起動する必要があります。そうでないと UTF-8 サポートがなくなります。上記の指示に従って en_US.UTF-8 ロケール(またはお使いのローカルの UTF-8 代替)を有効にし、デフォルトのロケールに設定した後、再起動してください。

URL encoding

URIs accept US-ASCII characters only and use percent-encoding to encode non-ASCII characters. This can result in very long and human-unreadable URIs.

In Firefox, it is possible to copy decoded URLs by enabling the browser.urlbar.decodeURLsOnCopy flag in about:config, or by inserting a space to the start of the URL, then selecting it (with the space) and copying it. However, this trick doesn't work on Chromium, and there is no equivalent flag. Alternatively, select starting at the end of the URL until right after the https:// part, then copy.

For command line usage, you can use python-urllib3 to translate encoded URLs from stdin.

$ python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read().strip()))"

トラブルシューティング

  • MP3 ファイルのエンコーディングの問題を修正するには、mp3unicode を使用してください。

抽出されたファイルのエンコーディングが間違っている場合

Windows の古いバージョン(XP、Vista、および 7)は、圧縮されたファイルの内容に対して異なるエンコーディングを使用します。展開するには、以下のコマンドを使用してください。

$ unzip -O CP932 file.zip