Google App Engine Data Warehouse Encoding?

I use the GAE datastore for a Java application and save some text that will be in many languages. In my servlet, I first check to see if there is any data in the data store, and if not, I create some that look like the following:

ArrayList<Lang> list = new ArrayList<Lang>();
list.add(new Lang("EN", "English", 1));
list.add(new Lang("ES", "Español", 0));
//more languages here...

PersistenceManager pm = PMF.get().getPersistenceManager();
for(Lang l : list) {
  pm.makePersistent(l);
}

Since this uses JDO, I think I should include the relevant parts of the class as well Lang:

@PersistenceCapable
public class Lang {
 @PrimaryKey
 private String code;
 @Persistent
 private String name;
 @Persistent
 private int popularity;
// getters & setters & constructors...
}

, ASCII, . , Eclipse UTF-8 Cp1252, , , App Engine , AdWords Espaà ± ol, , , 500 Server Error. ( , , ...)

- , GAE, UTF-8? Eclipse, -, Java?

+5
4

​​ , utf-8. , , "????..."

: HTTP- Apache, :

:

NameValuePair... params;
...
String url = urlBase + URLEncodedUtils.format(Arrays.asList(params), "UTF-8");
HttpGet httpGet = new HttpGet(url);

:

NameValuePair... params;
...
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(Arrays.asList(params), "UTF-8"));

: HttpServlet, :

HttpServletResponse resp;
...
resp.setContentType("text/html; charset=utf-8");
+1

? , , Python Data Viewer. Java.

0
0

, Eclipse UTF-8. , Java, "Español"?

0

All Articles