Skip to content

Commit

Permalink
[Truffle] - String#downcase should preserve the string encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasallan committed Dec 22, 2014
1 parent eb39810 commit a2277b1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,10 @@ public DowncaseNode(DowncaseNode prev) {
@Specialization
public RubyString downcase(RubyString string) {
notDesignedForCompilation();
ByteList newByteList = ByteList.create(string.toString().toLowerCase());
newByteList.setEncoding(string.getBytes().getEncoding());

return string.getContext().makeString(string.toString().toLowerCase());
return string.getContext().makeString(newByteList);
}
}

Expand Down

0 comments on commit a2277b1

Please sign in to comment.