Skip to content

Commit

Permalink
Merge pull request #601 from ably/feature/issue-596
Browse files Browse the repository at this point in the history
Replace use of StandardCharsets
  • Loading branch information
Quintin Willison authored Sep 11, 2020
2 parents abe2823 + 3ecd564 commit 2afb487
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/src/main/java/io/ably/lib/http/HttpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -147,7 +146,7 @@ public static String encodeURIComponent(String str) {
return null;
}

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

for (byte c : bytes) {
Expand Down
5 changes: 2 additions & 3 deletions lib/src/main/java/io/ably/lib/types/DecodingContext.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.ably.lib.types;

import java.util.Map;
import java.nio.charset.StandardCharsets;
import java.nio.charset.Charset;

public class DecodingContext {

Expand All @@ -18,7 +17,7 @@ public byte[] getLastMessageData() {
if(lastMessageBinary != null)
return lastMessageBinary;
else if(lastMessageString != null) {
return lastMessageString.getBytes(StandardCharsets.UTF_8);
return lastMessageString.getBytes(Charset.forName("UTF-8"));
}
else
return null;
Expand Down

0 comments on commit 2afb487

Please sign in to comment.