package o; import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import org.bouncycastle.i18n.LocalizedMessage; /* loaded from: classes.dex */ public final class NbY { /* JADX INFO: Access modifiers changed from: package-private */ public static Charset e(byte[] bArr) { String[] strArr = {"UTF-8", System.getProperty("file.encoding"), LocalizedMessage.DEFAULT_ENCODING}; for (int i = 0; i < 3; i++) { Charset forName = Charset.forName(strArr[i]); try { forName.newDecoder().decode(ByteBuffer.wrap(bArr)); return forName; } catch (CharacterCodingException unused) { } } return null; } }