svn commit: r16055 - trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-11-15 20:32:08-0800
New Revision: 16055

Modified:
   trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java

Log:
RESOLVED - task 4713: "xml dump" window displays wrong chars 
http://argouml.tigris.org/issues/show_bug.cgi?id=4713

Modified: trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java?view=diff&rev=16055&p1=trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java&p2=trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java&r1=16054&r2=16055
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/persistence/PersistenceManager.java	2008-11-15 20:32:08-0800
@@ -27,8 +27,8 @@
 import java.awt.Component;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.OutputStream;
 import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
@@ -40,6 +40,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.filechooser.FileFilter;
 
+import org.argouml.application.api.Argo;
 import org.argouml.configuration.Configuration;
 import org.argouml.configuration.ConfigurationKey;
 import org.argouml.i18n.Translator;
@@ -330,7 +331,7 @@
      * @return The whole model in a String.
      */
     public String getQuickViewDump(Project project) {
-        OutputStream stream = new ByteArrayOutputStream();
+        ByteArrayOutputStream stream = new ByteArrayOutputStream();
         try {
             quickViewDump.writeProject(project, stream, null);
         } catch (Exception e) {
@@ -339,7 +340,11 @@
             // useful feedback.
             e.printStackTrace(new PrintStream(stream));
         }
-        return stream.toString();
+        try {
+            return stream.toString(Argo.getEncoding());
+        } catch (UnsupportedEncodingException e) {
+            return e.toString();
+        }
     }
 
     /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.