> The common mistake is use string.format to concat strings may contain zeros.
>
> Maybe supporting embedded zeros would be better ?
That is not trivial to implement. We would need to implement flag '-',
width, and "precision". I don't think it is worth the trouble, to
support something that, as you said, is a mistake.
Lua support embedded zero strings elsewhere, so this limit is a little strange :)
Sometimes, string.format is more useful than string.pack . For example, to implement redis protocol (
http://redis.io/topics/protocol ) , it use a text protocol, but the string in the protocol may contain embedded zeros .