• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Subtitles Problem

     
    • 0 Vote(s) - 0 Average

    Subtitles Problem

    Subtitles Problem
    Yababakets
    Offline

    Junior Member

    Posts: 17
    Threads: 1
    Joined: 2023 Dec
    Reputation: 2
    #5
    2024-08-17, 08:11 AM (This post was last modified: 2024-08-17, 08:23 AM by Yababakets. Edited 3 times in total.)
    (2023-06-30, 04:26 PM)adymaster Wrote: I have a problem with the subtitles. In stead of diacritics appear (?), Romania Country.  

    Haw I can Solve that?

    Thanks

    Hi, based on the previous posts, the issue you're encountering with the question mark (?) replacing diacritics (Ăă, Ââ, Îî, Șș, Țț) isn't related to fonts, clients, or similar factors. The problem arises because the subtitle's character encoding is set to Central European ISO-8859-2 (which covers Albanian , Bosnian , Croatian , Czech , Finnish , German , Hungarian , Polish , Romanian , Rotokas , Serbian , Slovak , Slovene ,Upper Sorbian , Lower Sorbian , Turkmen ) , whereas Jellyfin prefers Unicode UTF-8.


    To resolve this, you can try the following methods:

    1. Use Gaupol (a subtitle editor):
      • Install Gaupol on your system. You can download the Windows version from here.
      • Open the subtitle file using the Central European (ISO-8859-2) character encoding.
      • Save the file with the Unicode ( UTF-8 ) character encoding.
    2. Use an online converter:
      • Visit an online encoding converter like FreeFormatter.
      • Upload your subtitle file and convert it from ISO-8859-2 to UTF-8.
      • Download the converted file. Note that this method might not successfully convert all characters.

    If you have a large number of subtitles, converting them individually could take a significant amount of time. Instead, you can create a Python script to automate the process. Here's how:
    •  Open a text file and add the following code:
    Code:
    import os
    import codecs

    # Function to check if a file is UTF-8 encoded
    def is_utf8(file_path):
        try:
            with open(file_path, 'r', encoding='UTF-8') as f:
                f.read()
            return True
        except UnicodeDecodeError:
            return False

    # Function to convert ISO-8859-2 to UTF-8
    def convert_encoding(file_path):
        with codecs.open(file_path, 'r', encoding='ISO-8859-2') as f:
            content = f.read()
        with codecs.open(file_path, 'w', encoding='UTF-8') as f:
            f.write(content)

    # Function to process directory
    def process_directory(directory):
        for root, dirs, files in os.walk(directory):
            for file in files:
                if file.endswith(('.sub', '.srt')):
                    file_path = os.path.join(root, file)
                    if not is_utf8(file_path):
                        convert_encoding(file_path)
                        print(f"Converted: {file_path}")
                    else:
                        print(f"Skipping: {file_path} (already UTF-8)")

    # Main function
    def main():
        directory = r"C:\your\path"  # Replace with the path to your folder containing the subtitles
        process_directory(directory)

    if __name__ == "__main__":
        main()
     
    • Save the file as iso2utf.py
    • Replace "C:\your\path" with your path
    • Ensure you have the latest version of Python installed to run the script.

    You can run the script in Command Prompt (Windows) or Terminal (macOS/Linux). Alternatively, you can open it in Visual Studio Code and run it from there.

    This script will automate the process of checking and converting subtitle files (formats .sub and .srt) from ISO-8859-2 to UTF-8 encoding.
    1
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Subtitles Problem - by adymaster - 2023-06-30, 04:26 PM
    RE: Subtitles Problem - by skribe - 2023-06-30, 09:23 PM
    RE: Subtitles Problem - by adymaster - 2023-07-01, 11:31 AM
    RE: Subtitles Problem - by skribe - 2023-07-02, 09:06 PM
    RE: Subtitles Problem - by Yababakets - 2024-08-17, 08:11 AM
    RE: Subtitles Problem - by Nemessis - 2024-12-27, 05:34 PM
    RE: Subtitles Problem - by biolan - 2025-01-02, 04:25 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode