Skip to content

Commit

Permalink
Use utf-8 encoding in set bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Jun 11, 2015
1 parent 53f8ef4 commit 2cb3c69
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ public static UTF8String fromString(String str) {
* Updates the UTF8String with String.
*/
public UTF8String set(final String str) {
bytes = str.getBytes();
try {
bytes = str.getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
// Turn the exception into unchecked so we can find out about it at runtime, but
// don't need to add lots of boilerplate code everywhere.
PlatformDependent.throwException(e);
}
return this;
}

Expand Down

0 comments on commit 2cb3c69

Please sign in to comment.