-
All of the examples I have seen on the internet are about strings. But the C function I need to work with only takes a single character as input. The C side expects UTF-8. But .NET |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
The concept of "single character" can be defined as multiple ways:
|
Beta Was this translation helpful? Give feedback.
-
Are you asking how to P/Invoke to a method that takes a For example, if your C method is [LibraryImport("<path>")]
public static partial void Method(byte c); |
Beta Was this translation helpful? Give feedback.
-
It's an UTF-8 character. For example, the Euro sign. Not a simple ASCII character. |
Beta Was this translation helpful? Give feedback.
-
The answer to your question/problem essentially entirely depends on the C function parameter data type that receives the 1..4 UTF-8 code units for a char/rune... |
Beta Was this translation helpful? Give feedback.
The answer to your question/problem essentially entirely depends on the C function parameter data type that receives the 1..4 UTF-8 code units for a char/rune...