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
Hello team! I'm having an issue with the Array type that I couldn't find an answer to in previous issues.
I'm bridging over a type of:
char cFileName[1024];
// to
@ffi.Array.multi([1024])
external ffi.Array<ffi.Char> cFileName;
I'm wondering how I should be converting that to a string. I'm currently doing it with:
return utf8.decode(_data.ref.spreadCFileName().toList(), allowMalformed:false);
Iterable<int> spreadCFileName() sync* {
for (var i =0; i <MAX_PATH; i++) {
final value = cFileName[i];
if (value ==0) {
return;
}
yield value;
}
}
This works, but fails to handle accents like in Charité which returns an error of: Unhandled Exception: FormatException: Invalid UTF-8 byte (at offset 16) unless I set allowMalformed: true
The text was updated successfully, but these errors were encountered:
Hello team! I'm having an issue with the Array type that I couldn't find an answer to in previous issues.
I'm bridging over a type of:
I'm wondering how I should be converting that to a string. I'm currently doing it with:
This works, but fails to handle accents like in
Charité
which returns an error of:Unhandled Exception: FormatException: Invalid UTF-8 byte (at offset 16)
unless I setallowMalformed: true
The text was updated successfully, but these errors were encountered: