The implementation of rdp_out_unistr() is a mess and the usage of the function is very inconsistent. It should do one thing, write a unicode string including EOS into a STREAM.
See bugs #5126 and #5236 for more information.
rdesktop (and associated tools) is being removed from the ThinLinc product.