Skip to content

Commit 0f98bc4

Browse files
committed
Document string marshaling behavior.
1 parent 688b09f commit 0f98bc4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/UsersManual.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ This is implemented by the [`DelegatesPass`](https://github.com/mono/CppSharp/bl
8686
- void* **** `System.IntPtr` / `System::IntPtr`
8787
- const char* **** `string` / `System::String`
8888

89+
Regular non-wide strings are assumed to be ASCII by default (marshaled with .NET `Marshal.PtrToStringAnsi`).
90+
Wide strings are marshaled either as UTF-16 or UTF-32, depending on the width of `wchar_t` for the target.
91+
92+
This behavior can be overriden by using the `Options.Encoding` setting.
93+
8994
#### References
9095

9196
References are mapped to .NET CLR references just like pointers.
@@ -351,7 +356,7 @@ standard library types:
351356
- `std::string`
352357
- `std::wstring`
353358

354-
These are mapped automatically to .NET strings.
359+
These are mapped automatically to .NET strings.
355360

356361
### Containers
357362

0 commit comments

Comments
 (0)