Possible character encoding migration problem?

Jmix version: 1.1.2
Jmix Studio plugin version: 1.1.4-213
IntelliJ IDEA 2021.3 CE - Build #IC-213.5744.223, built on November 27, 2021
Operating System: macOS 12.0.1 (21A559)
File System: Case-Sensitive Journaled HFS+ (APFS)
Datebase: PostgreSQL 13

Hi Everyone

For your information, yesterday I received this error in Jmix Studio

Jmix_Content_was_decoded_with_errors

and found that the following message text in my CUBA messages_en.properties file…

Cajón

was changed to…

Jmix_Content_was_decoded_with_errors_01

during my CUBA-to-Jmix 1.1.1 migration (I’m using 1.1.2 in the meantime).

Maybe there is an issue with the migration or some IntelliJ settings should be modified before starting the migration.

I hope that this information is useful.

Best regards
Chris

Hi @chrisbeaham

The default encoding for properties files set by IDEA is a ISO-8859-1:
image

It is the reason why such encoding is used in the new Jmix project after migration.
You can change it in the Settings > Editor > File Encodings.

Regards,
Nadezhda.

@n.shatalova

Hi Nadezhda

Thank you for the information. My default encoding for properties files set by IDEA is UTF-8 and not ISO-8859-1 and I never set this myself.

Jmix_Content_was_decoded_with_errors_02

And the Jmix documentation Message Bundles :: Jmix Documentation says “CAUTION Message bundle file must have the UTF-8 encoding”…

Jmix_Content_was_decoded_with_errors_03

so now I am a bit confused by your answer. I believe that this should be explicitly checked and set before migrating or somehow integrated into the migrating process to avoid the error case that I reported.

Best regards
Chris

@n.shatalova

Hi Nadezhda

For your information, I have a very strange behavior with this text. I have corrected it and checked my correction into my GitHub repository, here it is in GitHub…

Jmix_Content_was_decoded_with_errors_05

but my change keeps showing up as a new change when I want to commit other changes in Jmix Studio…

Jmix_Content_was_decoded_with_errors_04

and I have done at least 10 commits in the meantime.

This looks like a bug to me. Any ideas why this would occur?

Best regard
Chris

Hi @chrisbeaham

I tried to reproduce the problem using your scenario but after migration, I had no problem with encoding my *.properties files.
Could you please create a new Jmix project with locales you used and look and send us the results which encoding will be used there? It could be helpful to get the main issue reason.

@n.shatalova

Hi Nadezhda

I cannot reproduce the situation that I originally reported with this small sample CUBA project

charactersettest.zip (90.9 KB)

or with my original project using Jmix 1.1.1 or 1.1.3. My CUBA Studio and Jmix Studio are both set for UTF-8.

I tried running the migration immediately after starting IntelliJ and also after accessing different files in the project and opening and closing it to simulate some work but each time the result was the same; the text was correctly migrated.

But I am still having problems with the word Cajón that “sometimes” shows itself as a change while I commit my changes to GitHub. I just changed the words “Cajon Player” to “Cajón Player” and now again you see that the commit shows that the first word needs to be checked in again.
Jmix_Content_was_decoded_with_errors_06

In fact, I copied the first instance of the word (top of image) to use it in the “Cajón Player” message text (bottom of image). So this behavior is still strange; there is a bug somewhere.

I just upgraded to Jmix 1.1.3 and Studio 1.1.5 and will observe whether this problem was somehow corrected or not, however, I assume that it is an IntelliJ problem.

I will update this ticket again in the following days.

Best regards
Chris