Please ignore the title, I did more digging and edited below:
I have a very long string (51616 chars) that is being passed to my app (using web.py) from an html POST form with enctype="multipart/form-data". when I run my code locally with python 2.7.11, I get one result which works perfectly. when I run it in my app on PythonAnywhere, it is perfect except characters 16261-16293. Everything before/after that is right on.
Interestingly, Chrome makes the same mistakes as firefox, but slightly out of alignment.
Chrome, then firefox, then local(correct):
...LCJzb3VuZHNk2kb3RFp5JtAeUx2tHXjjBpgm4UHmcz9kUmFp...
...LCJzb3VIXk2kb3RFp5JtAeUx2tHXjjBpgm4UHmcjdGVkUmFp...
...LCJzb3VuZHNFbmFibGVkIjpmYWxzZSwiY29sbGVjdGVkUmFp...
the next part of my program is to base64.b64decode(string). If I do that on the incorrectly-spliced string, I get unicode continuation/start errors. Here's an example of decoding the incorrectly-spliced string: http://pastebin.com/1WdDbNfT. If you ctrl+f for 'purchaseti^' you'll see what's happening.
My guess is that the string is longer than some limit (string size, byte size, etc.) and the webserver is splicing two parts of it together somehow before sending it to the program. However it doesn't look like unicode and I've experimented with .encode() and .decode() with no luck. Also, if I post a PART of this 51k-character string, say 500 chars, it works just fine. any help with this would be greatly appreciated. Let me know if you need more info.
edit: relevant? http://stackoverflow.com/questions/2276759/php-whats-the-total-length-of-a-post-global-variable