fromNativeUtf8 static method

String fromNativeUtf8(
  1. Pointer<Char> pointer
)

Convert native UTF-8 string to Dart string safely

Implementation

static String fromNativeUtf8(Pointer<Char> pointer) {
  if (pointer == nullptr) {
    return '';
  }
  try {
    return pointer.cast<Utf8>().toDartString();
  } catch (e) {
    throw OracleMemoryException('Failed to convert native string: $e');
  }
}