using this code i persist data to GAE Store
but when storing Arabic it’s format in Store become ?????
how to support persist Arabic Text in GAE ?
the code :
PersistenceManager manager = PMF.get().getPersistenceManager();
Category category = new Category(categoryName);
manager.makePersistent(category);
manager.refresh(category);
manager.close();
It’s more likely that the text is corrupted when you submit it from a form, or render it to HTML, rather than when it is stored (or retrieved).
As a quick test, try this:
If that displays correctly (
السلام), then the problem is with the way the input is handled on its way into the application. If it still appears corrupted, try another test where you retrieve the category name, and within your application, compare it to the original value oftest. The test might look something like this:Log (or display) the value of
okay. Iffalse, then it really is the persistence layer that can’t handle Arabic. Post your findings, and we’ll work toward a solution once we are more confident where the problem truly is.Update: The servlet engine is not guaranteed to recognized the character encoding if you set it via
setHeader(). Use thesetContentType()method or thesetCharacterEncoding()method instead.