Skip to content

Commit

Permalink
[Truffle] Fixed a FindBugs issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Mar 21, 2015
1 parent 5fba8bb commit 8a20cf8
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -69,6 +69,7 @@
import org.jruby.util.StringSupport;
import org.jruby.util.io.EncodingUtils;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Locale;

Expand Down Expand Up @@ -1762,7 +1763,12 @@ public RubyString dump(RubyString string) {

ByteList outputBytes = dumpCommon(string);

outputBytes.append(".force_encoding(\"".getBytes());
try {
outputBytes.append(".force_encoding(\"".getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new UnsupportedOperationException(e);
}

outputBytes.append(string.getByteList().getEncoding().getName());
outputBytes.append((byte) '"');
outputBytes.append((byte) ')');
Expand Down

0 comments on commit 8a20cf8

Please sign in to comment.