kopia lustrzana https://github.com/ryukoposting/Signal-Android
Use StandardCharsets in OkHttpUtil.
okhttp3.internal.Util.UTF_8 was never meant to be used outside of okhttp3 library; and it has been deleted in later versions. Signal should use java.nio.charset.StandardCharsets instead. No functional change. Closes #12413fork-5.53.8
rodzic
13f3a8cf8a
commit
b92dd19a4c
|
@ -6,13 +6,12 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
import static okhttp3.internal.Util.UTF_8;
|
||||
|
||||
public final class OkHttpUtil {
|
||||
|
||||
private OkHttpUtil() {}
|
||||
|
@ -42,7 +41,7 @@ public final class OkHttpUtil {
|
|||
|
||||
byte[] data = readAsBytes(body.byteStream(), sizeLimit);
|
||||
MediaType contentType = body.contentType();
|
||||
Charset charset = contentType != null ? contentType.charset(UTF_8) : UTF_8;
|
||||
Charset charset = contentType != null ? contentType.charset(StandardCharsets.UTF_8) : StandardCharsets.UTF_8;
|
||||
|
||||
return new String(data, Objects.requireNonNull(charset));
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue