B4J Question Diferent codepage used in IDE than running .jar directly?

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
After being yesterday all afternoon looking for the reason why the data obtained from a database sometimes appeared with some characters "changed" and other times not, I have given when the reason is as follows:

If I execute the .jar directly the result is different to if the program is launched directly from the programming IDE.

See the attached image to better understand the problem.

Can I do something so that when executing from the IDE it behaves in the same way as when I execute the .jar directly?
 

Attachments

  • Captura.png
    Captura.png
    10.4 KB · Views: 198

Daestrum

Expert
Licensed User
Longtime User
You could try
B4X:
 #VirtualMachineArgs: -Dfile.encoding="UTF-8"
 
Upvote 0

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
You could try
B4X:
 #VirtualMachineArgs: -Dfile.encoding="UTF-8"

¿Where do I have to put it? ¿ Like a param of the .jar file ?

What I really need is that when running from the IDE, the application works as when I execute the .jar directly and not the other way round.

The data source is a Firebird DB that is not in UTF-8.
 
Last edited:
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i believe the different is running at jdk or jre.
at least i saw this in windows task manager.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You could try
B4X:
 #VirtualMachineArgs: -Dfile.encoding="UTF-8"
This will not help. The parameter will not be included in the executable jar.

You have a few options:
1. Run the jar with a batch file and add this parameter: -Dfile.encoding="UTF-8"
2. Convert it to an executable with launch4j and add the parameter: https://www.b4x.com/android/forum/threads/create-windows-native-executables-exe-files.35863/#content
3. Create a full packager and add the parameter to the installer.
 
Upvote 0
Top