theeggman85
theeggman85

Reputation: 1835

Storing text on GAE, non-standard unicode characters being changed

I have a servlet on Google App Engine that takes text from the page, stores it as an entity, and later sends it back to the client. When I store the word "You're", I get it showing up in the GAE localstore as "You're" as normal. When I return it to the client, however, I get "Youâre" and the debug code at times reads "Youâ??re". I am using the Java Text class to store this text.

How can I ensure that any Unicode characters can be stored correctly? It looks like client -> server is fine by the fact that the text does not change, but server -> client is definitely screwing up. Thanks!

Upvotes: 0

Views: 81

Answers (1)

Dave W. Smith
Dave W. Smith

Reputation: 24966

The majority of times I've seen this problem, either the page doesn't declare that it's using UTF-8, via something like

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

or accept-charset isn't set in the form.

Could either of those be the case here?

Upvotes: 1

Related Questions