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

Force encoding of Transkribus ALTO to UTF-8 #3885 #3886

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/transkribus/page_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def check_status_and_update_page

if status=='FINISHED'
alto_response = authorized_transkribus_request { get_processing_result(process_id) }
alto = alto_response.body
alto = alto_response.body.force_encoding('UTF-8') # HTTParty doesn't thinks the response is ASCII-8BIT but it's actually UTF-8
# write to the page
@page.alto_xml = alto.to_s
@page.alto_xml = alto
@page.save!
# mark the request as complete
@external_api_request.status = ExternalApiRequest::Status::COMPLETED
Expand Down