Skip to content

Encoding::UndefinedConversionError when trying to translate file #9

@Reion19

Description

@Reion19

Summary: when trying to download translated file, raises an error:

reproduce steps:

#rails console
test-app(dev)> doc = Rails.root.join("storage", "files", "file_name.pdf")
=> "full/path/to/file.pdf"
...
test-app(dev)> doc_handle = DeepL.document.upload(doc, 'EN', 'UK')
=> 
#<DeepL::Resources::DocumentHandle:0x000079d53d473c68
...
test-app(dev)> DeepL.document.download(doc_handle, Rails.root.join("storage", "files", "translated.pdf"))

/home/user/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/irb-1.14.3/lib/irb.rb:1262:in 'full_message': "\xC8" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

Actual Result (AR): Raises an error.
Expected Result (ER): The file is downloaded successfully.

Rails 7.2.2
Ruby 3.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions