I'm writing a web application in Google app Engine. It allows people to basically edit html code that gets stored as an .html
file in the blobstore.
I'm using fetchData to return a byte[]
of all the characters in the file. I'm trying to print to an html in order for the user to edit the html code. Everything works great!
Here's my only problem now:
The byte array is having some issues when converting back to a string. Smart quotes and a couple of characters are coming out looking funky. (?'s or japanese symbols etc.) Specifically it's several bytes I'm seeing that have negative values which are causing the problem.
The smart quotes are coming back as -108
and -109
in the byte array. Why is this and how can I decode the negative bytes to show the correct character encoding?