UCS-2はどうバイト列に直すのか

ところが、UCS-2 UCS-4の所を見ると、encoding form としての意味しか書いてなくて、encoding schemeは無い。つまり、バイト列で表す方法が定められていないということか。ううむ、これではエンコーディングと言っても、ファイルに書いたり、通信に使ったり出来ない。何らかの手段で、バイト列にシリアライズしないと。

これはISO/IEC 10646の規格を見る必要があります。無料でISO/IEC 10646:2003(E)はダウンロードできるのでとってきて、C039921e pdf/C039921e.pdfを見ると、

13.1 Two-octet BMP form (UCS-2)
This coded representation form permits the use of
characters from the Basic Multilingual Plane with each
character represented by two octets.
Within a CC-data-element conforming to the two-octet
BMP form, a character from the Basic Multilingual
Plane shall be represented by two octets comprising
the R-octet and the C-octet as specified in clause 6.2
(i.e. its RC-element).

とあり、clause 6.2を見ると、

6.2 Coding of characters
In the canonical form of the coded character set, each
character within the entire coded character set shall be
represented by a sequence of four octets. The most
significant octet of this sequence shall be the groupoctet.
The least significant octet of this sequence shall
be the cell-octet. Thus this sequence may be represented
as

m.s.     l.s.
Group-octet Plane-octet Row-octet Cell-octet

となっています。つまり、big endianですね。