Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1172,7 +1172,10 @@ public UpcaseNode(UpcaseNode prev) {
@Specialization
public RubyString upcase(RubyString string) {
notDesignedForCompilation();
return string.getContext().makeString(string.toString().toUpperCase());
ByteList byteListString = ByteList.create(string.toString().toUpperCase());
byteListString.setEncoding(string.getBytes().getEncoding());

return string.getContext().makeString(byteListString);
}

}
@@ -1191,8 +1194,10 @@ public UpcaseBangNode(UpcaseBangNode prev) {
@Specialization
public RubyString upcaseBang(RubyString string) {
notDesignedForCompilation();
ByteList byteListString = ByteList.create(string.toString().toUpperCase());
byteListString.setEncoding(string.getBytes().getEncoding());

string.set(ByteList.create(string.toString().toUpperCase()));
string.set(byteListString);
return string;
}
}

0 comments on commit ef0e585

Please sign in to comment.