ros2_rust icon indicating copy to clipboard operation
ros2_rust copied to clipboard

Unicode handling in String and WString

Open nwn opened this issue 1 year ago • 0 comments

According to https://design.ros2.org/articles/wide_strings.html, the string and wstring types must use the UTF-8 and UTF-16 encodings (not necessarily enforced), cannot contain null bytes or words (enforced), and, when bounded, are measured in terms of bytes or words.

Moreover, though the rosidl_runtime_c U16String type uses uint_least16_t, Rust guarantees the existence of a precise u16 type, so we should use that instead of ushort, which isn't guaranteed to be the same as uint_least16_t anyways. (Rust doesn't support platforms where uint_least16_t != uint16_t.)

nwn avatar Feb 04 '24 21:02 nwn