[Yanel-commits] rev 31104 - public/yanel/contributions/resources/gallery/src/java/org/wyona/yanel/impl/resources/gallery

michi at wyona.com michi at wyona.com
Fri Feb 1 14:03:22 CET 2008


Author: michi
Date: 2008-02-01 14:03:22 +0100 (Fri, 01 Feb 2008)
New Revision: 31104

Modified:
   public/yanel/contributions/resources/gallery/src/java/org/wyona/yanel/impl/resources/gallery/GalleryResource.java
Log:
encoding added explicitely

Modified: public/yanel/contributions/resources/gallery/src/java/org/wyona/yanel/impl/resources/gallery/GalleryResource.java
===================================================================
--- public/yanel/contributions/resources/gallery/src/java/org/wyona/yanel/impl/resources/gallery/GalleryResource.java	2008-02-01 12:52:09 UTC (rev 31103)
+++ public/yanel/contributions/resources/gallery/src/java/org/wyona/yanel/impl/resources/gallery/GalleryResource.java	2008-02-01 13:03:22 UTC (rev 31104)
@@ -23,6 +23,8 @@
  */
 public class GalleryResource extends BasicXMLResource implements ModifiableV2{
     protected static final Logger log = Logger.getLogger(GalleryResource.class);
+
+    static private String ENCODING = "utf-8";
     
     /**
      * On delete this parameter gives the item id for deletion
@@ -93,12 +95,12 @@
             getEnvironment().getResponse().setHeader("Expires", "0");
         }
         
-        return new ByteArrayInputStream(content.getBytes());
+        return new ByteArrayInputStream(content.getBytes(ENCODING));
     }
     
     private String generateGalleryAtom(Gallery gallery){
-        StringBuffer feed = new StringBuffer("<?xml version='1.0' ?>"+"\n");
-        feed.append("<feed xmlns='http://www.w3.org/2005/Atom'>"+"\n");
+        StringBuffer feed = new StringBuffer("<?xml version=\"1.0\" encoding=\"" + ENCODING + "\"?>"+"\n");
+        feed.append("<feed xmlns=\"http://www.w3.org/2005/Atom\">"+"\n");
         
         feed.append("<id>"+gallery.getId()+"</id>"+"\n");
         feed.append("<title>"+gallery.getTitle()+"</title>"+"\n");



More information about the Yanel-commits mailing list