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

copy-to-clipboard-inline-macro causes Asciidoctor to fail when document contains non-Ascii chars on Windows #234

Open
abelsromero opened this issue Oct 13, 2017 · 0 comments

Comments

@abelsromero
Copy link

Issue Overview

When converting a UTF-8 file that contains non-Ascii characters (e.g: ¿, á, é) I get the error:

org.jruby.exceptions.RaiseException: (Encoding::CompatibilityError) incompatible encodings: UTF-8 and CP850 

Using asciidoctor-maven-plugin, document works without the extension, and I double-check the files are in UTF-8.

Steps To Reproduce
  1. Create a simple AsciiDoc document
= Título

Maravilloso documento, ¿verdad?

== Sub-sección

Dedicada a Ramón.
  1. Convert with the extension
Additional Information

Solution found.

The issue seems to be in Document::read_asset here, but I'd like to check before filing an issue to main project.

For some reason, the Javascript string is encoded in Windows format and Asciidoctor triggers the issue when the string is inserted in a document with non-Ascii chars.

Forcing content.chomp to be UTF-8 with content.chomp.force_encoding("UTF-8") fixes the issue.
Calling read_asset with :normlize => true (ref) did nothing.

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

1 participant