Skip to content

Enable heuristic character set detection for SRT subtitles #2247

Closed

Description

@WoKee

verion: 1.6.0-rc01

Two ways:

  1. Using a local cheat, it appears as garbled code.
    After transcoding the file stream to UTF-8, it can be displayed normally.
    Path.utf8(file)

  2. When adding subtitles online, it appears as garbled text.
    new MediaItem.SubtitleConfiguration.Builder(Uri.parse(getUrl())).setLabel(getName()).setMimeType(getFormat()).setSelectionFlags(getFlag()).setLanguage(getLang()).build();

file :

【ATV】【大俠霍元甲】01.zip

Activity

  1. self-assigned this
    on Mar 19, 2025
  2. icbaker commented on Mar 19, 2025

    @icbaker
    Collaborator

    The provided file is an SRT file. I agree with #2167 (comment), this is a duplicate of google/ExoPlayer#3644. I will close that and use this to track it instead, to move it to this issue tracker.

  3. changed the title [-]How to solve the problem of garbled text when loading online non-UTF-8 subtitles, such as GBK?[/-] [+]Enable heuristic character set detection for SRT subtitles[/+] on Mar 19, 2025
  4. WoKee commented on Aug 20, 2025

    @WoKee
    Author

    The provided file is an SRT file. I agree with #2167 (comment), this is a duplicate of google/ExoPlayer#3644. I will close that and use this to track it instead, to move it to this issue tracker.

    • Is there a planned solution?
    • It has been a long time.
  5. icbaker commented on Aug 20, 2025

    @icbaker
    Collaborator
    • Is there a planned solution?

    Plans have not changed since google/ExoPlayer#3644 (comment), in particular this sentence is still true:

    It's unlikely we'll find the time to add this support any time soon - but we would accept a high quality PR adding this.

  6. icbaker commented on Sep 28, 2026

    @icbaker
    Collaborator

    This is fixed by 081a432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions