Skip to content

Commit

Permalink
Trying this. Seemingly now all symbol(String) in RubySymbol will be 8…
Browse files Browse the repository at this point in the history
…859_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.
enebo committed Dec 14, 2017
1 parent 6d1577b commit 4a07463
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/java/org/jruby/RubySymbol.java
Original file line number Diff line number Diff line change
@@ -151,12 +151,14 @@ public final String asJavaString() {
* Return a raw (ISO-8859_1) string for use with our method tables etc.
*/
public String getRawString() {
return StringSupport.bytelistAsBinaryString(symbolBytes);
return symbol;
}

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

final ByteList getBytes() {

0 comments on commit 4a07463

Please sign in to comment.