Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update native encoding detection for JEP400 #1393

Commits on Oct 29, 2021

  1. Check if system property native.encoding is set and use that to deter…

    …mine default charset
    
    JNA used the defaultCharset to determine which encoding to use when
    converting strings to native char*. The defaultCharset is set from
    the system property file.encoding. Up to JDK 17 its value defaulted
    to the system default encoding. From JDK 18 onwards its default value
    changed to UTF-8.
    JDK 18+ exposes the native encoding as the new system property
    native.encoding, prior versions don't have that property and will
    report NULL for it.
    The algorithm is simple: If native.encoding is set, it will be used
    else the original implementation of Charset#defaultCharset is used.
    matthiasblaesing committed Oct 29, 2021
    Copy the full SHA
    62e85bc View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    b9112a8 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    06ec1e4 View commit details
    Browse the repository at this point in the history