piranha/tnetstrings.js — pull request #6 by tOkeshu (2012-05-17 16:18:56+00:00)
Title: Fix multibyte string handling.

The pull request #3 did not fully fixed the problem of multibyte strings.
Indeed, the size of the total payload is not calculated with the `stringLength` function.
Thus incorrect length can occurs if a multibyte string inside an object is dumped.

Moreover, there is the same problem when parsing TNetStrings with multibyte strings.
So for instance, if you dump one then try to parse it, it will fail.

To fix this I first added a failing test then added a new `payloadLength` function which does the opposite of `stringLength`.

Tell me what you think :)