[foreign-memaccess+abi] RFR: 8268230: Foreign Linker API & Windows user32/kernel32: String conversion seems broken [v3]

Jorn Vernee jvernee at openjdk.java.net
Tue Jun 15 15:12:16 UTC 2021


> The problem is that we only add a single 0 byte as a null terminator, regardless of the charset used. For wider char sets, more 0 bytes need to be added. For instance, for UTF_16LE two 0 bytes need to be added.
> 
> This patch fixes the issue by adding the null terminator to the Java string, and only then encoding it as a `byte[]`.

Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:

  Fix tests after merge

-------------

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/554/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/554/files/9df822a7..aba2b1a1

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=554&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=554&range=01-02

  Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/554.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/554/head:pull/554

PR: https://git.openjdk.java.net/panama-foreign/pull/554


More information about the panama-dev mailing list