Skip to content

Commit

Permalink
Hotfix client sdk depend jdk7 charset. (#3376)
Browse files Browse the repository at this point in the history
  • Loading branch information
KomachiSion authored Jul 18, 2020
1 parent cda3f14 commit e5f0c36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.alibaba.nacos.client.identify;

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

/**
* Provides Base64 encoding and decoding as defined by <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>.
Expand Down Expand Up @@ -179,7 +179,7 @@ public Base64(int lineLength, byte[] lineSeparator, boolean urlSafe) {
if (lineSeparator != null) {
if (containsAlphabetOrPad(lineSeparator)) {
String sep = null;
sep = new String(lineSeparator, StandardCharsets.UTF_8);
sep = new String(lineSeparator, Charset.forName("UTF-8"));
throw new IllegalArgumentException("lineSeparator must not contain base64 characters: [" + sep + "]");
}
if (lineLength > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
* Sign util.
Expand All @@ -31,7 +30,7 @@
*/
public class SignUtil {

public static final Charset UTF8 = StandardCharsets.UTF_8;
private static final Charset UTF8 = Charset.forName("UTF-8");

public SignUtil() {
}
Expand Down

0 comments on commit e5f0c36

Please sign in to comment.