Closed avenue68 closed 5 months ago
When the diagram code is embedded in the adoc file it's read by asciidoctor itself. Asciidoctor always assumes UTF-8 encoding if I recall correctly. When using the block macro syntax the diagram code is read by calling File.readlines
. MRI has been UTF-8 by default since 2.0. JRuby seems to be inheriting the default behaviour from the JDK which was platform dependent up to Java 18. That or grade is setting it. The external file seems to be incorrectly getting read using the Windows-31J encoding and that's causing the error.
I'll change the extension to explicitly use UTF-8 when reading external files so that you get the same behaviour in both cases. As a workaround, you could try adding -Dfile.encoding=UTF-8
to your gradle invocation and see if that resolves the issue.
Thanks for your explanation!
Adding -Dfile.encoding=UTF-8
resolved the issue!
I'm using asciidoctor gradle plugin and I'm trying to import
.puml
files into a.adoc
file but as I mentioned in the title,.puml
files are not imported correctly when they include multi byte characters in them. But the PlantUML diagrams are rendered properly even they include multi byte characters when they are written directly on.adoc
files.A
.puml
fileAn
.adoc
file// this doesn't have any problems. [plantuml] .... :あ: --> (い) ....
unable to render AsciiDoc document
org.asciidoctor.jruby.internal.AsciidoctorCoreException: org.jruby.exceptions.EncodingError$InvalidByteSequenceError: (InvalidByteSequenceError) asciidoctor: FAILED: C:\path\to.adoc: Failed to load AsciiDoc document - "\x82" followed by ":" on Windows-31J
Any ideas?