kaklakariada / portmapper

A tool for managing port forwardings via UPnP
GNU General Public License v3.0
685 stars 89 forks source link

Encoding error #58

Closed zyzkevin closed 3 years ago

zyzkevin commented 4 years ago

image My settings (locale) are currently US Eng; however, the program isn't displaying the right characters.

kaklakariada commented 4 years ago

Maybe there is an issue with locale selection. Please try to explicitly set the locale:

java -Duser.language=en -jar portmapper.jar

See https://github.com/kaklakariada/portmapper#select-language

kaiwu-astro commented 3 years ago

Dear developer, I have the same problem. I tried

java -Duser.language=en -jar portmapper.jar

and it gives

Error: Could not find or load main class .language=en
Cause : java.lang.ClassNotFoundException: /language=en

If I use language=de and it gives the same error (with .language=de)

I am running the program on Windows 10 with

openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)

kaklakariada commented 3 years ago

Is it possible that there is a whitespace or hidden special character before the . in your command, e.g.

$ java -Duser .language=en -jar build/libs/portmapper-2.2.1-all.jar
Error: Could not find or load main class .language=en
Caused by: java.lang.ClassNotFoundException: /language=en

This is the only way I could explain the error message you get.

kaiwu-astro commented 3 years ago

Thank you for your quick reply.

I just comfirmed that there is no special character by typing the whole cmmand line again.

But I just solved this problem. I used to type the command in powershell, which always gives the error. I switch to cmd, and everything works fine. (stupid powershell)

kaklakariada commented 3 years ago

You are right. The problem only occurs using Powershell. I used bash before. You need to put the argument in double quotes, then it will also work with powershell:

java "-Duser.language=en" -jar build/libs/portmapper-2.2.1-all.jar

I will update the documentation.