Interestingly, from this code, I understand the exact opposite of
unicode strings are currently not supported
We are obviously using unicode codec UTF-8
to encode and decode it, and the matching python type is a unicode string. So looking at this code, I would say :
’ A string
field in a ROS message is a unicode string, and will be encoded/decoded using UTF-8 for serialization/deserialization’
And in that case the wiki should state :
- Primitive Type: string
- Serialization: utf-8 string (4)
- C++: std::string
- Python3: str
- Python2: unicode
On the other hand, if this is not true and the ROS serialization is only supporting ASCII, then the python matching type should be bytes, and the wiki should say :
- Primitive Type: string
- Serialization: ascii string (4)
- C++: std::string
- Python3: bytes
- Python2: str
and the serialization code needs to be fixed ( no need to encode/decode, unicode is not supported ).