I have an UTF-8
string and I need to get the byte array of UTF-16
encoding, so how can I convert my string to UTF-16
byte array?
Update:
I mean we have Encoding.Unicode.GetBytes()
or even Encoding.UTF8.GetBytes()
function to get byte array of strings, what about UTF-16
? We don't have any Encoding.UTF16.GetBytes()
so how can I get the byte array?