mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Use UTF-8 everywhere
UTF-8 is the default charset on Android so this should be a no-op change, but makes the code portable (in case it runs on another platform). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=167011583
This commit is contained in:
parent
049d41db2a
commit
e80a93d799
2 changed files with 3 additions and 2 deletions
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.util;
|
||||
|
||||
import com.google.android.exoplayer2.C;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
|
|
@ -428,7 +429,7 @@ public final class ParsableByteArray {
|
|||
* @return The string encoded by the bytes.
|
||||
*/
|
||||
public String readString(int length) {
|
||||
return readString(length, Charset.defaultCharset());
|
||||
return readString(length, Charset.forName(C.UTF8_NAME));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ public final class Util {
|
|||
* @return The code points encoding using UTF-8.
|
||||
*/
|
||||
public static byte[] getUtf8Bytes(String value) {
|
||||
return value.getBytes(Charset.defaultCharset()); // UTF-8 is the default on Android.
|
||||
return value.getBytes(Charset.forName(C.UTF8_NAME));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue