> So is this just a UCS2BE conversion? If so, then using
> be clearer.
Basically yes. But with l_utf8_to_ucs2be this will look something like:
You'll potentially need this step in either version actually.
utf8_get_codepoint isn't really enough to tell whether the entire string is
valid utf8. Where is the password coming from?
Also, I would think you'd pre-validate utf8 validity before ever getting to this
ucs2 = l_utf8_to_ucs2be(utf, out_len);
memcpy(out_buf, ucs2, *out_len);
I can do that but it seems we're doing less work without using
You could add an own buffer version of utf8_to_ucs2be. But even this memcpy
version seems to be cleaner than open-coding it.