Skip to content

Commit 4a07463

Browse files
committedDec 14, 2017
Trying this. Seemingly now all symbol(String) in RubySymbol will be 8859_1 or
a raw string. So I made toString() decode to actual charset based on encoding. This may need another field if we discover toString() on RubySymbol is called all the time but let's roll with this made on-demand for now.
1 parent 6d1577b commit 4a07463

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎core/src/main/java/org/jruby/RubySymbol.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ public final String asJavaString() {
151151
* Return a raw (ISO-8859_1) string for use with our method tables etc.
152152
*/
153153
public String getRawString() {
154-
return StringSupport.bytelistAsBinaryString(symbolBytes);
154+
return symbol;
155155
}
156156

157157
@Override
158158
public final String toString() {
159-
return symbol;
159+
// FIXME: This is not efficient but in theory this is just for display purposes
160+
// which generally are for errors?
161+
return StringSupport.byteListAsString(symbolBytes);
160162
}
161163

162164
final ByteList getBytes() {

0 commit comments

Comments
 (0)
Please sign in to comment.