I want to convert a UnicodeString using ICU to a UTF-16 string, encoded in big-endian, for sending through a socket.
The big-endian thing is messing me up. I can't seem to find any resources relating to the topic with ICU and C++. Using C#, I could do System.Text.Encoding.BigEndianUnicode.GetBytes, but ICU seems to offer me no such alternative.
How do I convert an ICU UnicodeString into a big-endian, UTF-16 byte array?