Skip to content

subparse: Autodetect subtitle text encoding

Copied from https://gitlab.freedesktop.org//gstreamer/gst-plugins-base/-/merge_requests/942

Use uchardet to guess the subtitle text encoding if it is not in UTF-8 or manually specified instead of blindly guessing its "ISO-8859-15". The uchardet dependency is optional and when is not available at compile time, then old behaviour will be used.

About uchardet:

uchardet is an encoding detector library, which takes a sequence of bytes
in an unknown character encoding without any additional information,
and attempts to determine the encoding of the text.

Returned encoding names are iconv-compatible.

uchardet library is part of Freedesktop project.

Closes gst-plugins-base#9

Edited by Rafał Dzięgiel

Merge request reports