Skip to content

Commit

Permalink
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyFile.java
Original file line number Diff line number Diff line change
@@ -1370,8 +1370,7 @@ private static RubyString filePathConvert(ThreadContext context, RubyString path
pathEncoding != encodingService.getAscii8bitEncoding() &&
pathEncoding != encodingService.getFileSystemEncoding(runtime) &&
!path.isAsciiOnly()) {
ByteList bytes = EncodingUtils.strConvEnc(context, path.getByteList(), pathEncoding, encodingService.getFileSystemEncoding(runtime));
path = RubyString.newString(runtime, bytes);
path = EncodingUtils.strConvEnc(context, path, pathEncoding, encodingService.getFileSystemEncoding(runtime));
}
}

2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ext/stringio/StringIO.java
Original file line number Diff line number Diff line change
@@ -1007,7 +1007,7 @@ public IRubyObject write(ThreadContext context, IRubyObject arg) {
if (enc != encStr && enc != EncodingUtils.ascii8bitEncoding(runtime)
// this is a hack because we don't seem to handle incoming ASCII-8BIT properly in transcoder
&& encStr != ASCIIEncoding.INSTANCE) {
str = runtime.newString(EncodingUtils.strConvEnc(context, strByteList, encStr, enc));
str = EncodingUtils.strConvEnc(context, str, encStr, enc);
}
len = str.size();
if (len == 0) return RubyFixnum.zero(runtime);

0 comments on commit 4e84246

Please sign in to comment.