In my opinion, unicode flag is taken into account in the process of validating message length. What is wrong, is that unicode flag is not validated against real message content, where either real content should take precedence over the flag value (which puts in doubt the need of this argument) or error should be reported to a user.