Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve encoding detection of the XML TV file #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thombet
Copy link

@thombet thombet commented Apr 28, 2020

The encoding of the XML TV file can be found either:

  1. with a regular expression on the encoding tag in the XML file
  2. or using the chardet.detect() function on the content of the XML file

Option 1 is improved by updating the regex: an encoding tag using
single quotes will also be detected now.

Option 2 could last more than several minutes for huge files. So if the
file has more than 50,000 characters, the detection is done only on the
first 50,000 characters (which should be enough to detect the encoding).

The encoding of the XML TV file can be found either:
 1. with a regular expression on the encoding tag in the XML file
 2. or using the chardet.detect() function on the content of the XML file

Option 1 is improved by updating the regex: an encoding tag using
single quotes will also be detected now.

Option 2 could last more than several minutes for huge files. So if the
file has more than 50,000 characters, the detection is done only on the
first 50,000 characters (which should be enough to detect the encoding).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant