Skip to content

Instantly share code, notes, and snippets.

@headius
Created March 28, 2016 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/642d4895873f28ee806b to your computer and use it in GitHub Desktop.
Save headius/642d4895873f28ee806b to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/util/io/EncodingUtils.java b/core/src/main/java/org/jruby/util/io/EncodingUtils.java
index 6fee359..62e29ce 100644
--- a/core/src/main/java/org/jruby/util/io/EncodingUtils.java
+++ b/core/src/main/java/org/jruby/util/io/EncodingUtils.java
@@ -50,7 +50,7 @@ import org.jruby.util.TypeConverter;
import java.util.Arrays;
public class EncodingUtils {
- public static final int ECONV_DEFAULT_NEWLINE_DECORATOR = Platform.IS_WINDOWS ? EConvFlags.CRLF_NEWLINE_DECORATOR : 0;
+ public static final int ECONV_DEFAULT_NEWLINE_DECORATOR = Platform.IS_WINDOWS ? EConvFlags.UNIVERSAL_NEWLINE_DECORATOR : 0;
public static final int DEFAULT_TEXTMODE = Platform.IS_WINDOWS ? OpenFile.TEXTMODE : 0;
public static final int TEXTMODE_NEWLINE_DECORATOR_ON_WRITE = Platform.IS_WINDOWS ? EConvFlags.CRLF_NEWLINE_DECORATOR : 0;
diff --git a/core/src/main/java/org/jruby/util/io/OpenFile.java b/core/src/main/java/org/jruby/util/io/OpenFile.java
index ea659fd..0214f60 100644
--- a/core/src/main/java/org/jruby/util/io/OpenFile.java
+++ b/core/src/main/java/org/jruby/util/io/OpenFile.java
@@ -920,10 +920,10 @@ public class OpenFile implements Finalizable {
IRubyObject ecopts;
byte[] sname, dname;
ecflags = encs.ecflags & ~EConvFlags.NEWLINE_DECORATOR_WRITE_MASK;
- if (isTextMode() && Platform.IS_WINDOWS) {
- // we can't do O_TEXT so we always do CRLF translation on Windows
- ecflags = ecflags | EConvFlags.UNIVERSAL_NEWLINE_DECORATOR;
- }
+// if (isTextMode() && Platform.IS_WINDOWS) {
+// // we can't do O_TEXT so we always do CRLF translation on Windows
+// ecflags = ecflags | EConvFlags.UNIVERSAL_NEWLINE_DECORATOR;
+// }
ecopts = encs.ecopts;
if (encs.enc2 != null) {
sname = encs.enc2.getName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment