Skip to content

Commit

Permalink
encoding issue fixed, #144
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed May 24, 2022
1 parent aad4168 commit 47c427a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/metanorma/utils/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down Expand Up @@ -328,7 +329,7 @@ public static String unzipFileToString(Path zipPath, String fileName) {
total -= read;
}

strResult = new String(bytes);
strResult = new String(bytes, StandardCharsets.UTF_8);
break;
}
}
Expand Down
13 changes: 7 additions & 6 deletions src/main/resources/docx2mn.adoc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@
</xsl:choose>
</xsl:variable>

<xsl:variable name="filename" select="concat($sectionsFolder,$pathSeparator,$section_name,'.adoc')"/>

<redirect:write file="{$docfile}">
<xsl:text>include::</xsl:text><xsl:value-of select="$filename"/><xsl:text>[]</xsl:text>
<xsl:text>include::</xsl:text><xsl:value-of select="concat($sectionsFolder,'/',$section_name,'.adoc')"/><xsl:text>[]</xsl:text>
<xsl:text>&#xa;&#xa;</xsl:text>
</redirect:write>

<xsl:variable name="filename" select="concat($sectionsFolder,$pathSeparator,$section_name,'.adoc')"/>

<redirect:write file="{concat($outpath,$pathSeparator,$filename)}">
<xsl:apply-templates />
</redirect:write>
Expand Down Expand Up @@ -330,9 +330,10 @@
</xsl:variable>
<xsl:variable name="bibdata_items" select="xalan:nodeset($bibdata_items_)"/>

<!-- <xsl:apply-templates select="$bibdata_items" mode="print_as_xml"/> -->

<redirect:write file="{$docfile}">

<!-- DEBUG:
<xsl:apply-templates select="$bibdata_items" mode="print_as_xml"/> -->

<xsl:text>:docnumber: </xsl:text><xsl:value-of select="$bibdata_items//item[@name = 'docnumber']"/>
<xsl:text>&#xa;</xsl:text>
Expand All @@ -341,7 +342,7 @@
<xsl:text>:copyright-year: </xsl:text><xsl:value-of select="substring($bibdata_items//item[@name = 'date'],1,4)"/>
<xsl:text>&#xa;</xsl:text>

<xsl:text>:title-main-en: </xsl:text><xsl:value-of select="$bibdata_items//item[@name = 'title-main-en']"/>
<xsl:text>:title-main-en: </xsl:text><xsl:value-of select="$bibdata_items//item[@name = 'title-main-en'][last()]"/>
<xsl:text>&#xa;</xsl:text>


Expand Down

0 comments on commit 47c427a

Please sign in to comment.