diff --git a/src/org/jruby/RubyString.java b/src/org/jruby/RubyString.java index c39a9f6..1769f29 100644 --- a/src/org/jruby/RubyString.java +++ b/src/org/jruby/RubyString.java @@ -3834,11 +3834,10 @@ public class RubyString extends RubyObject implements EncodingCapable { * */ public String getUnicodeValue() { - try { - return new String(value.bytes, value.begin, value.realSize, "UTF-8"); - } catch (Exception e) { - throw new RuntimeException("Something's seriously broken with encodings", e); - } + // we use the encodingless version so it uses the platform encoding in all cases + // since what we really want here is "assume bytes are in platform encoding and + // convert to a UTF-16 string". + return new String(value.bytes, value.begin, value.realSize); } @Override