バイト列

バイト列

[1] オクテット列 (octet sequence, octet stream) は、 オクテットです。 バイト列 (byte sequence) は、バイトです。 ほとんどの場合、これらは交換可能な用語と考えられています。

[2] 厳密にはオクテットバイトは異なりますが、 現代においてはバイトは8ビットと同義とされることがほとんどなので、 オクテット列バイト列は同義になります。

仕様書

意味

[15] バイト列 (byte sequence) は、 1つ以上バイトリストであって、 最初のバイトの位置と最後のバイトの位置が曖昧なく識別できるものです。 >>14

[16] この定義だと空バイト列バイト列でないことになります。

文字列とオクテット列

[3] 歴史的にオクテット列/バイト列文字列は同義または類義と考えられていた場面もありますが、 本来両者は別のものです。

[6] 近年のプログラミング言語やデータ交換形式などではバイト列文字列を区別するケースが増えていますが、 かつては同一視するのが一般的でした。

[7] 例えばC言語では普通 char は8ビットの符号無し整数を表しますが、 文字1つを表すためにも使われています。

[9] Perl には utf8フラグのある文字列と、ないバイト列があります。 ただし両者間は暗黙の型変換があり、 0x00-0xFF の範囲では両者の区別が曖昧です。

[8] JavaScript には長らく文字列 String しかありませんでしたが、 ES6バイト列のための TypedArray が追加されました。 TypedArray

[23] ASCII文字列, 同型符号化, 同型復号も参照。

MIME 型

[4] 他に適当なMIME型が無い場合、 application/octet-stream を使うことになっています。

歴史

[5] Character Model for the World Wide Web 1.0: Fundamentals ( ( 版)) http://www.w3.org/TR/charmod/#sec-Strings

[10] Bug 26499 – Improve the definition of 'byte sequence' to make it less ta... · 6936e73 · whatwg/mimesniff ( ( 版)) https://github.com/whatwg/mimesniff/commit/6936e7323b7bbff4f1f047bfa50b06c8a259889b

[11] Integrate Fetch into HTML · whatwg/html@7c5555a ( 版) https://github.com/whatwg/html/commit/7c5555a16f2920c02244c10756bb2f1a11e87a22

[12] Use backticks around header names and values · whatwg/html@9329c5a ( 版) https://github.com/whatwg/html/commit/9329c5a77980d541bcc07ac9f5a2489ba42df729

[13] Replace byte stream with ReadableStream · whatwg/xhr@243bb82 ( 版) https://github.com/whatwg/xhr/commit/243bb82b5249e6405705b8eb252dd8bd416bd5f6

[17] Editorial: refactor to depend on the Infra Standard (domenic著, ) https://github.com/whatwg/html/commit/4ac633e08c2c9430853fc8322943bc2438ed36a3

[18] Editorial: start using the Infra Standard (annevk著, ) https://github.com/whatwg/fetch/commit/9ba4e78e5cb5fc1132f89d7e344cd2c2e1950c67

[19] Limit the bytes you can express as string more (annevk著, ) https://github.com/whatwg/infra/commit/b99c4cd6bb8dd958ff66854aceda459baee41636

[20] Note how to get a byte sequence out of a string (annevk著, ) https://github.com/whatwg/infra/commit/8ca1cf3f500b030507e884742277e98f4482536c

[21] Define length for byte sequences and strings (annevk著, ) https://github.com/whatwg/infra/commit/c484a4fe0d7bdc52b0f17ab99e49eaa9e56e3f56

[22] Editorial: let code point and friends be defined by Infra (annevk著, ) https://github.com/whatwg/html/commit/59595d9c2ccadb9332c15048be5d30174532ee70