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

Fixes Byte Order Mark in Downloaded file list, again. #1137

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions PixivDownloadHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ def download_image(caller,
raise
else:
PixivHelper.print_and_log('info', ' done.')

# codecs.open is stateless, so if platform_encoding == utf-8-sig each new line starts from utf-8-sig
# this is bad and I feel bad

if os.path.isfile(caller.dfilename):
dfile_encoding = 'utf-8'
else:
dfile_encoding = caller.platform_encoding

# write to downloaded lists
if caller.start_iv or config.createDownloadLists:
Expand Down