On Windows Vista, I get
"Lua error: Internal error: Unable to decode message."
for any string that contains explicit \n char, the same for multiline strings with long-brackets and for mw.log().
I've found an explication and an almost working fix in this thread on mediawiki.org :
see there for details. After changed to the better replace (that I'll post there after I get the bug number here), I've not seen any bug so far. Obviously it's not a cross-platform solution, but maybe could be a hint to one.
OS: Windows Vista