BUG-7013: do not rely on default character encoding
[mdsal.git] / binding / maven-sal-api-gen-plugin / src / main / java / org / opendaylight / yangtools / yang / unified / doc / generator / GeneratorImpl.xtend
index 5462a14cb50d43a6f6b48d5ec992ce2a28bae31c..654b53160207c1d70be17567962ab4e15371ff24 100644 (file)
@@ -12,6 +12,7 @@ import java.io.BufferedWriter
 import java.io.File
 import java.io.IOException
 import java.io.OutputStreamWriter
+import java.nio.charset.StandardCharsets
 import java.text.SimpleDateFormat
 import java.util.ArrayList
 import java.util.Collection
@@ -84,7 +85,7 @@ class GeneratorImpl {
         this.ctx = ctx;
         module.imports.forEach[importModule | this.imports.put(importModule.prefix, importModule.moduleName)]
         try {
-            val fw = new OutputStreamWriter(CTX.newFileOutputStream(destination))
+            val fw = new OutputStreamWriter(CTX.newFileOutputStream(destination), StandardCharsets.UTF_8)
             val bw = new BufferedWriter(fw)
             currentModule = module;
             bw.append(generate(module, ctx));