You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 file
@startuml:あ:--> (い)
@enduml
An .adoc file
// the above .puml file is not imported properly.plantuml::diagrams.puml[]// this doesn't have any problems.[plantuml]....:あ: --> (い)....
The exposed error message
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
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.
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..puml
file.adoc
fileAny ideas?
The text was updated successfully, but these errors were encountered: