pub struct WChar(pub char);Expand description
IDL wchar wrapper for the CORBA/GIOP 1.2 wire form. Holds a single
Unicode scalar (char), but unlike the DDS XCDR2 wchar (a bare 2-byte
UTF-16 code unit, no prefix) the GIOP 1.2 form is a 1-octet length
(the octet count of the wchar in the transmission code set — 2 for a BMP
character in UTF-16) followed by the UTF-16 code unit(s).
Byte order: the code units are emitted big-endian regardless of the
message byte order. This is the consensus oracle-confirmed behaviour of
both omniORB 4.3 (writes 02 00 41 for 'A' even inside a little-endian
encapsulation) and JacORB 3.9 (02 00 41, big-endian message). The default
UTF-16 transmission wide code set has no per-wchar BOM, so network
(big-endian) order is used. wchar 'A' (U+0041) = 02 0041.
A CORBA wchar is a single transmission unit: real ORBs (omniORB
CORBA::WChar, Java char) are 16-bit, so only BMP characters occur
(length 2, one unit). A non-BMP scalar would need a UTF-16 surrogate pair
(length 4, two units); the encoder handles that defensively even though the
ORBs cannot produce it through write_wchar.
Tuple Fields§
§0: charImplementations§
Trait Implementations§
Source§impl CdrDecode for WChar
impl CdrDecode for WChar
Source§fn decode(reader: &mut BufferReader<'_>) -> Result<Self, DecodeError>
fn decode(reader: &mut BufferReader<'_>) -> Result<Self, DecodeError>
Source§const IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
CdrEncode::IS_PRIMITIVE. Controls DHEADER reading when
decoding sequence<T>/T[N] with non-primitive T.Source§impl CdrEncode for WChar
impl CdrEncode for WChar
Source§fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§const IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
true
only for primitives (bool, octet, int8/16/32/64, uint8/16/32/64,
float, double, char/wchar). false for aggregate/variable
types (string, struct, union, enum, sequence, array, map).
Controls DHEADER prepending for sequence<T>/T[N]:
collections with NON-primitive elements need a DHEADER (uint32 =
byte length of the following content) under XCDR2.