CharsetDetector


@UnstableApi
interface CharsetDetector


Detects the character encoding of subtitle byte data.

Summary

Public functions

Charset?
detect(data: ByteArray<Byte>!, offset: Int, length: Int)

Detects the character encoding of the requested range of data.

Public functions

detect

fun detect(data: ByteArray<Byte>!, offset: Int, length: Int): Charset?

Detects the character encoding of the requested range of data.

The requested range is not guaranteed to contain a complete subtitle file.

Parameters
data: ByteArray<Byte>!

The subtitle byte data.

offset: Int

The start offset in data.

length: Int

The number of bytes to inspect.

Returns
Charset?

The detected character encoding, or null if it could not be determined.