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

feat: optional stdout decoding #350

Closed
Sofurs opened this issue Nov 11, 2023 · 0 comments
Closed

feat: optional stdout decoding #350

Sofurs opened this issue Nov 11, 2023 · 0 comments

Comments

@Sofurs
Copy link
Contributor

Sofurs commented Nov 11, 2023

Please allow us to convert text (e.g. markdown) to PDF format using convert_text function with the outputfile parameter set to "-" (stdout).

try:
    stdout = stdout.decode('utf-8')
except UnicodeDecodeError:
    # this shouldn't happen: pandoc more or less guarantees that the output is utf-8!
    raise RuntimeError('Pandoc output was not utf-8.')

Currently the function raises the UnicodeDecodeError exception.

Sofurs added a commit to Sofurs/pypandoc that referenced this issue Nov 11, 2023
Do not decode stdout if the bytes cannot be represented as UTF-8.

Refs: JessicaTegner#350
JessicaTegner added a commit that referenced this issue Jan 18, 2024
Do not decode stdout if the bytes cannot be represented as UTF-8.

Refs: #350

Co-authored-by: Jessica Tegner <jessica.tegner@outlook.com>
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