Skip to content

Commit

Permalink
Merge branch 'release/0.6.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
yulingtianxia committed Apr 18, 2022
2 parents 1b6dafa + d95edc5 commit 89f9973
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions dart_native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.5

* [Fix] Fix utf16 issue on iOS.

## 0.6.4

* [Fix] Failed to load dynamic library on Android.
Expand Down
2 changes: 1 addition & 1 deletion dart_native/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.6.3"
version: "0.6.5"
dart_native_gen:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions dart_native/lib/src/darwin/common/pointer_encoding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ String? structNameForEncoding(String encoding) {
}

String loadStringFromPointer(Pointer<Void> ptr) {
final dataPtr = ptr.cast<Int16>();
final dataPtr = ptr.cast<Uint16>();
// get data length
const lengthDataSize = 4;
final lengthData = dataPtr.asTypedList(lengthDataSize);
Expand All @@ -293,7 +293,7 @@ String loadStringFromPointer(Pointer<Void> ptr) {
lengthData[2] << 16 |
lengthData[3];
// get utf16 data
Int16List data = dataPtr.elementAt(lengthDataSize).asTypedList(length);
Uint16List data = dataPtr.elementAt(lengthDataSize).asTypedList(length);
String result = String.fromCharCodes(data);
// malloc dataPtr on native side, should free the memory.
calloc.free(dataPtr);
Expand Down
2 changes: 1 addition & 1 deletion dart_native/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_native
description: Write native code using Dart. This package liberates you from native code and low performance channel.
version: 0.6.4
version: 0.6.5
homepage: https://github.com/dart-native/dart_native

environment:
Expand Down

0 comments on commit 89f9973

Please sign in to comment.