Fixing encoding error when importing files

This commit is contained in:
Pablo Luna 2011-01-16 18:05:17 -03:00
parent 89b2a871e2
commit 47793ec4e2

View File

@ -38,6 +38,7 @@ import javax.xml.bind.JAXBException;
import java.io.InputStream; import java.io.InputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.Charset;
import java.util.*; import java.util.*;
import java.math.BigInteger; import java.math.BigInteger;
@ -86,7 +87,7 @@ public class FreemindImporter
JAXBUtils.saveMap(mindmapMap,out,"com.wisemapping.xml.mindmap"); JAXBUtils.saveMap(mindmapMap,out,"com.wisemapping.xml.mindmap");
map = new MindMap(); map = new MindMap();
map.setNativeXml(out.toString()); map.setNativeXml(new String(out.toByteArray(), Charset.forName("UTF-8")));
map.setTitle(mapName); map.setTitle(mapName);
map.setDescription(description); map.setDescription(description);
map.setNativeBrowser(new MindMapNative()); map.setNativeBrowser(new MindMapNative());