You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2019/07/16 20:26:56 UTC

[royale-compiler] branch develop updated: JSWriter, MXMLWriter, ASWriter: uses getBytes('utf8') so that files are written as UTF-8 instead of the default

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new b95cd6f  JSWriter, MXMLWriter, ASWriter: uses getBytes('utf8') so that files are written as UTF-8 instead of the default
b95cd6f is described below

commit b95cd6f3d47e1d21f1693347dc7bce676c72b682
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue Jul 16 13:26:49 2019 -0700

    JSWriter, MXMLWriter, ASWriter: uses getBytes('utf8') so that files are written as UTF-8 instead of the default
    
    This should prevent the need to specify -Dfile.encoding=UTF8 when compiling
---
 .../java/org/apache/royale/compiler/internal/codegen/as/ASWriter.java | 2 +-
 .../java/org/apache/royale/compiler/internal/codegen/js/JSWriter.java | 4 ++--
 .../org/apache/royale/compiler/internal/codegen/mxml/MXMLWriter.java  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/as/ASWriter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/as/ASWriter.java
index 1384a9d..62ef771 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/as/ASWriter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/as/ASWriter.java
@@ -77,7 +77,7 @@ public class ASWriter implements IASWriter
 
         try
         {
-            out.write(writer.toString().getBytes());
+            out.write(writer.toString().getBytes("utf8"));
         }
         catch (IOException e)
         {
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSWriter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSWriter.java
index 0f383a3..6773d23 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSWriter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSWriter.java
@@ -99,7 +99,7 @@ public class JSWriter implements IJSWriter
         
         try
         {
-            jsOut.write(emitter.postProcess(writer.toString()).getBytes());
+            jsOut.write(emitter.postProcess(writer.toString()).getBytes("utf8"));
         }
         catch (IOException e)
         {
@@ -130,7 +130,7 @@ public class JSWriter implements IJSWriter
                 String fileName = compilationUnitFile.getName();
                 fileName = fileName.replace(".as", ".js");
                 String sourceMap = sourceMapEmitter.emitSourceMap(fileName, sourceMapFilePath, sourceRoot);
-                jsSourceMapOut.write(sourceMap.getBytes());
+                jsSourceMapOut.write(sourceMap.getBytes("utf8"));
             } catch (Exception e)
             {
                 e.printStackTrace();
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLWriter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLWriter.java
index add3601..9e45aaf 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLWriter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/MXMLWriter.java
@@ -70,7 +70,7 @@ public class MXMLWriter extends JSWriter
 
         try
         {
-            out.write(mxmlEmitter.postProcess(writer.toString()).getBytes());
+            out.write(mxmlEmitter.postProcess(writer.toString()).getBytes("utf8"));
         }
         catch (IOException e)
         {
@@ -101,7 +101,7 @@ public class MXMLWriter extends JSWriter
                 String fileName = compilationUnitFile.getName();
                 fileName = fileName.replace(".mxml", ".js");
                 String sourceMap = sourceMapEmitter.emitSourceMap(fileName, sourceMapFilePath, sourceRoot);
-                sourceMapOut.write(sourceMap.getBytes());
+                sourceMapOut.write(sourceMap.getBytes("utf8"));
             } catch (Exception e)
             {
                 e.printStackTrace();