On the other side, there is aslo Exploit::CmdStagerPrintf who isn't using echo, but the printf command. It supports octal representation. So I recommend:

* switch to Exploit::CmdStagerPrintf if it works smoothly with the set of targets you've already available
* If Exploit::CmdStagerPrintf isn't good enough here, use the same way than Exploit::CmdStagerPrintf to cut the end of a part when slicing the payload :)