def writeShortString(strng):
    """Write a short string - see readShortString for the format.

    """
    strbytes = strng.encode('utf-16')
    encoding    = strbytes[0:2]
    lengthfield = bytearray(2)
    lengthfield[0] = 0xff
    lengthfield[1] = len(strng)
    strfield    = strbytes[2:]

    return encoding + lengthfield + strfield