Skip to content

Fixes the Encoding error in Windows system#4

Open
kephalian wants to merge 1 commit intorobert-haas:masterfrom
kephalian:patch-1
Open

Fixes the Encoding error in Windows system#4
kephalian wants to merge 1 commit intorobert-haas:masterfrom
kephalian:patch-1

Conversation

@kephalian
Copy link

Transformation

    with open(filepath, 'w', encoding="utf-8") as file_handle:
        html_text = self.to_html()

added
encoding = "utf-8"
at line 122.

This fixes error in encoding because Windows uses ISO as default encoding, leading to error UnicodeEncodeError

UnicodeEncodeError: 'charmap' codec can't encode characters \uxxxx at position (something)

data_structures.py

PLEASE NOTE THIS MIGHT BE A FIX OF WINDOWS SYSTEM WITH ISO ENCODING Only. This option should not create any problems as default encoding is utf in Linux and almost everywhere else.

Please reach me, Dr Santhosh Rajamani at minerva.santh@gmail.com if any other information is needed about this error.

# Transformation
        with open(filepath, 'w', encoding="utf-8") as file_handle:
            html_text = self.to_html()
added 
encoding = "utf-8"
at line 122.

This fixes error in encoding because Windows uses ISO as default encoding, leading to error UnicodeEncodeError

UnicodeEncodeError: 'charmap' codec can't encode characters \uxxxx at position (something)

data_structures.py 

PLEASE NOTE THIS MIGHT BE A FIX OF WINDOWS SYSTEM WITH ISO ENCODING Only.
This option should not create any problems as default encoding is utf in Linux and almost everywhere else.

Please reach me, Dr Santhosh Rajamani at minerva.santh@gmail.com if any other information is needed about this error.
@AHU03 AHU03 mentioned this pull request Jan 26, 2024
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