liuyuqi-dellpc 2 years ago
parent
commit
f9d4262542
2 changed files with 5 additions and 5 deletions
  1. 3 3
      Dockerfile
  2. 2 2
      convert.go

+ 3 - 3
Dockerfile

@@ -2,9 +2,9 @@ FROM kfwkfulq.mirror.aliyuncs.com/library/ubuntu:20.10 as dev
 LABEL Name=wordtohtml Version=1.0.5
 EXPOSE 5000
 
-ENV LANG     en_US.UTF-8
-ENV LANGUAGE en_US.UTF-8
-ENV LC_ALL   en_US.UTF-8
+ENV LANG     C.UTF-8
+# ENV LANGUAGE en_US.UTF-8
+# ENV LC_ALL   en_US.UTF-8
 
 # Install requirements
 RUN apt update && \

+ 2 - 2
convert.go

@@ -13,6 +13,6 @@ func doCommand(cmd string) {
 func main() {
 	// if diretory not exist, create it
 	doCommand("mkdir -p output")
-	doCommand("libreoffice --headless --convert-to html *.doc --outdir output")
-	doCommand("libreoffice --headless --convert-to html *.docx --outdir output")
+	doCommand("libreoffice --headless --convert-to "html:XHTML Writer File:UTF8" *.doc --outdir output")
+	doCommand("libreoffice --headless --convert-to "html:XHTML Writer File:UTF8" *.docx --outdir output")
 }