とある環境で、いただいたApacheの設定ファイルを配置し、configtestを行うと、以下のエラーが出た。 Invalid command '\xef\xbb\xbf', perhaps misspelled or defined by a module not included in the server configuration ファイルの文字コードは、UTF8でしたが、"EF BB BF"は「BOM」と呼ばれる、テキストがUnicodeで書かれているか、や、記述形式の識別を行うための符号らしい。 (恥ずかしながら初めて知った。) ■BOM (Byte Order Mark, バイト・オーダー・マーク) UnicodeのUTF-16などの16bit単位の文字エンコーディングスキームでは、8bit単位でデータを配列する際のエンディアンとして、ビッグエンディアンとリトルエンディアンの
[ 2005-October-01 20:15 ] Tim Bray describes why Unicode and UTF-8 are wonderful much better than I could, so go read that for an overview of what Unicode is, and why all your programs should support it. What I'm going to tell you is how to use Unicode, and specifically UTF-8, with one of the coolest programming languages, Python, but I have also written an introduction to Using Unicode in C/C++.
Unicode HOWTO¶ Release: 1.12 This HOWTO discusses Python’s support for the Unicode specification for representing textual data, and explains various problems that people commonly encounter when trying to work with Unicode. Introduction to Unicode¶ Definitions¶ Today’s programs need to be able to handle a wide variety of characters. Applications are often internationalized to display messages and o
文字コード変換プログラムのiconvでは、文字コード「UTF-8」において、入出力ともにBOMを用いません。 出力においてBOMを使わないということは、すぐに納得がいくことと思います。UTF-8として出力されるバイト列の先頭にBOMがつかないということです。 かたや、入力においてというのがどういうことかというと、BOMに相当するバイト列を 見ても、それをBOMとは認識しないということです。 つまり、データ先頭にEF BB BFという3バイトがあったら、それをBOMとして消費するのでなく、単なる普通の1文字のように扱うのです。 ちょっと実験してみましょう。 UTF-8にBOMを付けて出力するプログラムとしてポピュラーなのはWindowsのメモ帳です(XPで確認)。メモ帳でUTF-8としてテキストを保存するともれなくBOMがついてきます。 例えば、メモ帳で「あ」とだけ書いて改行し、UTF-8で
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く