fromWString function

String fromWString(
  1. Pointer<NativeType> ptr, {
  2. int? len,
})

Implementation

String fromWString(Pointer ptr, {int? len}) {
  if(len == null) { len = wstringLen(ptr); }

  if (Platform.isWindows) {
    return String.fromCharCodes(ptr.cast<Uint16>().asTypedList(len));
  } else {
    return String.fromCharCodes(ptr.cast<Uint32>().asTypedList(len));
  }
}