File tree 1 file changed +7
-2
lines changed
core/src/main/java/org/jruby/truffle/nodes/core
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1172,7 +1172,10 @@ public UpcaseNode(UpcaseNode prev) {
1172
1172
@ Specialization
1173
1173
public RubyString upcase (RubyString string ) {
1174
1174
notDesignedForCompilation ();
1175
- return string .getContext ().makeString (string .toString ().toUpperCase ());
1175
+ ByteList byteListString = ByteList .create (string .toString ().toUpperCase ());
1176
+ byteListString .setEncoding (string .getBytes ().getEncoding ());
1177
+
1178
+ return string .getContext ().makeString (byteListString );
1176
1179
}
1177
1180
1178
1181
}
@@ -1191,8 +1194,10 @@ public UpcaseBangNode(UpcaseBangNode prev) {
1191
1194
@ Specialization
1192
1195
public RubyString upcaseBang (RubyString string ) {
1193
1196
notDesignedForCompilation ();
1197
+ ByteList byteListString = ByteList .create (string .toString ().toUpperCase ());
1198
+ byteListString .setEncoding (string .getBytes ().getEncoding ());
1194
1199
1195
- string .set (ByteList . create ( string . toString (). toUpperCase ()) );
1200
+ string .set (byteListString );
1196
1201
return string ;
1197
1202
}
1198
1203
}
You can’t perform that action at this time.
0 commit comments