Skip to content

Fix exiftool JSON decoding to use UTF-8#2067

Open
Vedant43hh wants to merge 1 commit into
microsoft:mainfrom
Vedant43hh:fix-exiftool-utf8-decoding
Open

Fix exiftool JSON decoding to use UTF-8#2067
Vedant43hh wants to merge 1 commit into
microsoft:mainfrom
Vedant43hh:fix-exiftool-utf8-decoding

Conversation

@Vedant43hh
Copy link
Copy Markdown

Description

ExifTool always outputs JSON in UTF-8, but exiftool_metadata() decoded the output using locale.getpreferredencoding(False).

On systems where the locale encoding is not UTF-8 (for example Windows cp936/GBK), this can raise UnicodeDecodeError when metadata contains non-ASCII characters.

This PR decodes the JSON output explicitly as UTF-8.

Fixes #1972

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.

fix: exiftool JSON output decoded with locale encoding instead of UTF-8

2 participants