excelsior-oss / excelsior-jet-maven-plugin

Excelsior JET Maven Plugin provides Maven users with an easy way to compile their applications down to optimized native Windows, OS X, or Linux executables with Excelsior JET
https://www.excelsiorjet.com
GNU General Public License v3.0
72 stars 16 forks source link

Ability to set output encoding for expire message #22

Open galvanopus opened 8 years ago

galvanopus commented 8 years ago
  1. pom.xml is encoded in UTF-8.
  2. Trial message is written in Russian. For example, "Ой, все!".
  3. Application outputs ╨Ю╨╣, ╨▓╤Б╨╡! — this is how UTF-8 looks in Cp866.

In Excelsior GUI we can use workaround "Ћ©, ўбҐ!", because prj files are Cp1251, not UTF-8.

It would be fine to have <expireMessageCodepage>Cp866<expireMessageCodepage>

One more workaround is to use chcp 65001. This command switches cmd.exe codepage to UTF-8, but it has side effects.

pjBooms commented 8 years ago

Cool! It is known problem in Excelsior JET since we released Trial Version generation feature (JET-2188 internal issue number while current max number is JET-8387 -- ten years old issue). Nobody complained about it since that time! The problem that Windows uses different encodings for console output and in GUI dialogs, while we store expiration message in GUI platform encoding (which is CP1251 for Russian). And if console is disabled the message is shown correctly in Russian.

It is better to fix the problem in Excelsior JET itself, automatically choosing right encoding when printing it to the console on Windows. However, I'm not sure that the fix will be planned for the next release.

On the other hand, indeed, it can be fixed in the Maven plugin with the workaround you suggested. Moreover we can automatically use right encoding based on <hideConsole> plugin parameter. However, what confuses me is that it is just workaround fooling JET, not a real fix. Thus I would prefer, if you could provide a Pool Request with the workaround.

galvanopus commented 8 years ago

@pjBooms, do you mean the following workaround: plugin reads <expireMessageCodepage>Cp866<expireMessageCodepage>, converts expiration message to specified encoding, pass converted message to JET?

pjBooms commented 8 years ago

Yes.