Skip to content

Commit

Permalink
Set encoding on SubprocessTabula initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
chezou committed Nov 20, 2023
1 parent 76db276 commit 5c23bb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions tabula/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def __init__(
)
)

if encoding == "utf-8":
if not any("file.encoding" in opt for opt in java_options):
java_options += ["-Dfile.encoding=UTF8"]

self.java_options = java_options
self.encoding = encoding

Expand Down
4 changes: 0 additions & 4 deletions tabula/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,6 @@ def read_pdf(
if not any("java.awt.headless" in opt for opt in java_options):
java_options += ["-Djava.awt.headless=true"]

if encoding == "utf-8":
if not any("file.encoding" in opt for opt in java_options):
java_options += ["-Dfile.encoding=UTF8"]

path, temporary = localize_file(input_path, user_agent, use_raw_url=use_raw_url)

if not os.path.exists(path):
Expand Down

0 comments on commit 5c23bb2

Please sign in to comment.