We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53f8ef4 commit 2cb3c69Copy full SHA for 2cb3c69
unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
@@ -56,7 +56,13 @@ public static UTF8String fromString(String str) {
56
* Updates the UTF8String with String.
57
*/
58
public UTF8String set(final String str) {
59
- bytes = str.getBytes();
+ try {
60
+ bytes = str.getBytes("utf-8");
61
+ } catch (UnsupportedEncodingException e) {
62
+ // Turn the exception into unchecked so we can find out about it at runtime, but
63
+ // don't need to add lots of boilerplate code everywhere.
64
+ PlatformDependent.throwException(e);
65
+ }
66
return this;
67
}
68
0 commit comments