Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/ext/digest/RubyDigest.java
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@
import java.util.HashMap;
import java.util.Map;

import org.jcodings.specific.USASCIIEncoding;
import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyFixnum;
@@ -146,7 +147,7 @@ private static ByteList toHex(byte[] val) {
}

private static IRubyObject toHexString(Ruby runtime, byte[] val) {
return RubyString.newStringNoCopy(runtime, ByteList.plain(toHex(val)));
return RubyString.newStringNoCopy(runtime, new ByteList(ByteList.plain(toHex(val)), USASCIIEncoding.INSTANCE));
}

@JRubyMethod(name = "hexencode", required = 1, meta = true)

0 comments on commit 5c6293c

Please sign in to comment.