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

Preamble file encoding undefined #285

Closed
Kuszki opened this issue Aug 19, 2023 · 1 comment
Closed

Preamble file encoding undefined #285

Kuszki opened this issue Aug 19, 2023 · 1 comment

Comments

@Kuszki
Copy link

Kuszki commented Aug 19, 2023

Selecting custom preamble file via --preabmle=file causes the file is open in raw mode thus all non-ascii characters are broken in output file.

Please add support to -e | --encoding so it can set encoding for preamble file or just use locale-default encoding for it.

How to reproduce:

  1. Create UTF-8 coded preamble file, then use any non-ascii character in this file
  2. Call latexdiff with --preabmle=file
  3. Output contains bad characters

https://github.com/ftilmann/latexdiff/blob/1f9d07fd1b6edd914804442de0b396264311df8b/latexdiff#L1879C7-L1879C11

@ftilmann
Copy link
Owner

Sorry for the delay, I did as you suggested: it will use the encoding, if set explicitly with --encoding option, and the locale encoding otherwise. It will not use the encoding guessed from reading the input latex files, though, as in the current flow the preamble file is read before the encoding is guessed.

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

No branches or pull requests

2 participants