You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of this method uses com.kenai.jffi.MemoryIO#getZeroTerminatedByteArray(long, int) to get a byte array containing the string data. For various encodings, like UTF-16, this does not work correctly. The code actually needs to look for the representation of the 0 code point in the encoding in question instead of just looking for a single 0 valued byte.
The text was updated successfully, but these errors were encountered:
While digging through the code this morning I was looking at jnr.ffi.provider.converters.StringResultConverter#fromNative. This implementation does do the right thing and takes terminator width into account.
The implementation of this method uses
com.kenai.jffi.MemoryIO#getZeroTerminatedByteArray(long, int)
to get a byte array containing the string data. For various encodings, like UTF-16, this does not work correctly. The code actually needs to look for the representation of the0
code point in the encoding in question instead of just looking for a single0
valued byte.The text was updated successfully, but these errors were encountered: