mhayashi1120/Emacs-langtool

German messages have display problems on windows.

ThomasGier opened this issue · 2 comments

Hello,

I have an issue with the output coming from LanguageTool not displaying correctly.
I'm using the German language, langtool 1.5.1 on Windows 8.1 with emacs 25.2 and LanguageTool 3.7.

The issue appears with umlauts and the "ß" character, as shown below (and probably unicode characters in other languages).

issue

To fix the issue I took the second example from here and modified langtool as follows to switch java encoding to UTF-8:

diff --git a/langtool.el b/langtool.el
index 029bba4..b6aaad5 100644
--- a/langtool.el
+++ b/langtool.el
@@ -626,7 +626,9 @@ Ordinary no need to change this."
                                  "org.languagetool.commandline.Main")
                            args))
       (setq args (append
-                  (list "-jar" (langtool--process-file-name langtool-language-tool-jar))
+                  (list "-Dfile.encoding=UTF-8"
+                        "-jar"
+                        (langtool--process-file-name langtool-language-tool-jar))
                   args)))
     (when langtool-mother-tongue
       (setq args (append args (list "-m" langtool-mother-tongue))))

fixed

Hi, thanks for the issue.

Please try process-custom-args branch

https://github.com/mhayashi1120/Emacs-langtool/tree/process-custom-args

and set:

(setq langtool-java-user-arguments '("-Dfile.encoding=UTF-8"))

Hi,

I've tested the new branch and it fixes the issue.
Thank you for the quick response.