Skip to content

Commit 2afb487

Browse files
author
Quintin Willison
authored
Merge pull request ably#601 from ably/feature/issue-596
Replace use of StandardCharsets
2 parents abe2823 + 3ecd564 commit 2afb487

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/src/main/java/io/ably/lib/http/HttpUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.net.URLDecoder;
99
import java.net.URLEncoder;
1010
import java.nio.charset.Charset;
11-
import java.nio.charset.StandardCharsets;
1211
import java.util.ArrayList;
1312
import java.util.HashMap;
1413
import java.util.List;
@@ -147,7 +146,7 @@ public static String encodeURIComponent(String str) {
147146
return null;
148147
}
149148

150-
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
149+
byte[] bytes = str.getBytes(Charset.forName("UTF-8"));
151150
StringBuilder builder = new StringBuilder(bytes.length);
152151

153152
for (byte c : bytes) {

lib/src/main/java/io/ably/lib/types/DecodingContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.ably.lib.types;
22

3-
import java.util.Map;
4-
import java.nio.charset.StandardCharsets;
3+
import java.nio.charset.Charset;
54

65
public class DecodingContext {
76

@@ -18,7 +17,7 @@ public byte[] getLastMessageData() {
1817
if(lastMessageBinary != null)
1918
return lastMessageBinary;
2019
else if(lastMessageString != null) {
21-
return lastMessageString.getBytes(StandardCharsets.UTF_8);
20+
return lastMessageString.getBytes(Charset.forName("UTF-8"));
2221
}
2322
else
2423
return null;

0 commit comments

Comments
 (0)