In the general case of cryptographic hashes you don't want the hash to reveal anything about your message.
In the case where that's not important, it is a good idea to provide the length information in the protocol separately. For example when you sign a public key with PGP or gpg, both a hash of that key and its length are signed.
Comment on Re: (OT)Speculation: 128-bit digest + 64-bit length (192-bits) is more reliable and unique than a 256-digest alone.