-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Prior to java 18, which standardized on UTF-8, the system default charset was dependent on the host OS and locale (unless the user or server settings were influencing it.) Nearly any default was fine as long as the channels were dealing with ASCII text, but anything beyond that usually leads to unexpected behavior on some systems. The appropriate encoding for a channel to use is almost always dependent on the data source or sink, and not on the host system on which the OIE server is running.
It is now considered best practice to always specify the charset/encoding explicitly when converting between bytes and characters/strings.
I think there should be a preference, which defaults to UTF-8, but can be overridden by the user, for the charset to use for new connectors.
For a user running open-source Mirth or OIE on Windows in the US with a Java version less than 18, their system default is likely windows-1252. Upgrading to java 21 would cause it to change to UTF-8 with no changes to the channel configuration. If some channels were depending on windows-1252, this can cause data corruption issues.
If it's possible, we should do a migration for any connectors set to "Default" to the actual system default, and not allow "Default" in the drop down selection. For the theoretical user above, if this migration occurs before their java version upgrade, their channels will be converted to windows-1252 and be unaffected by the system default charset change.