[英]How to save unicode string into datastore google appengine using java
I'm working Google App Engine using Java, i receive data from form fields and save into datastore. 我正在使用Java使用Google App Engine,我从表单字段接收数据并将其保存到数据存储区中。 I receive Unicode string from HttpServletRequest
like this: 我从HttpServletRequest
收到Unicode字符串,如下所示:
URLDecoder.decode(request.getParameter("text"),"UTF-8")
It returns Unicode string correctly, then i save this string into datastore 它正确返回Unicode字符串,然后我将此字符串保存到数据存储区中
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Entity entity = new Entity("TextEntity");
entity.setProperty("text", URLDecoder.decode(
req.getParameter("name"), "UTF-8"));
entity.setProperty("createdOn", new Date());
datastore.put(entity);
I saw as picture below: 我看到如下图:
As you can see, the text field with unreadable characters. 如您所见,文本字段包含不可读的字符。 How can I solve this problem? 我怎么解决这个问题? Please help me out. 请帮帮我。
It is a problem with the datastore viewer of the development server. 开发服务器的数据存储查看器存在问题。 I just ran into this exact same problem, but on the production server, the values are OK. 我只是遇到了这个完全相同的问题,但是在生产服务器上,这些值还可以。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.