Menu

#812 JNA encoding issue on non-UTF-8 platforms

6.1
open-fixed
reminder (3)
5
2023-09-27
2016-04-10
No

JNA 4.0 introduced an (apparently unintended) change in behavior by which Java strings passed to native libraries would always be encoded in UTF-8 instead of the platform's native encoding (discussion).

We upgraded JNA to an affected version with the upgrade to LanguageTool 3.2. The encoding issue manifested itself as a failure to load Hunspell dictionaries located at a path containing non-ASCII characters (on Windows only?) (user group thread).

A number of libraries we use also use JNA under the hood, and it's not clear how they are affected by the issue, but it does seem clear that the correct behavior is to use the platform's native encoding.

I have submitted a PR to fix this in JNA; until we can upgrade to a fixed version, it seems prudent to work around the issue by globally setting the default encoding via the jna.encoding system property.

When we are able to upgrade JNA to a fixed version, we can remove this workaround. This ticket should remain open until then.

Related

Feature Requests: #970

Discussion

  • Aaron Madlon-Kay

    The workaround is committed in trunk, r8709.

     
  • Aaron Madlon-Kay

    • labels: --> reminder
     
  • Hiroshi Miura

    Hiroshi Miura - 2023-09-26

    Removal of workaround is proposed.
    https://github.com/omegat-org/omegat/pull/757

     
  • Hiroshi Miura

    Hiroshi Miura - 2023-09-27
    • status: open --> open-fixed
    • Group: 4.0 --> 6.1
     
  • Hiroshi Miura

    Hiroshi Miura - 2023-09-27

    merged to master.

     

Log in to post a comment.

MongoDB Logo MongoDB