Default to UTF-8 instead of throwing exception
authorDennis Schafroth <dennis@indexdata.com>
Mon, 25 Jun 2012 20:50:07 +0000 (22:50 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Mon, 25 Jun 2012 20:50:07 +0000 (22:50 +0200)
src/org/marc4j/TurboMarcXmlWriter.java

index 8e89f5a..2645e79 100644 (file)
@@ -275,7 +275,8 @@ public class TurboMarcXmlWriter implements MarcWriter {
             throw new NullPointerException("null OutputStream");\r
         }\r
         if (encoding == null) {\r
-            throw new NullPointerException("null encoding");\r
+          // Default to UTF-8\r
+          encoding = "UTF8";\r
         }\r
         try {\r
             setIndent(indent);\r