Replies: 2 comments 8 replies
-
The only alternative I can think of is to use For 16-bit characters, UTF-16 is well understood when using |
Beta Was this translation helpful? Give feedback.
-
I'm a bit unclear right now as to the right path forward for the Dart projection, so this thread is interesting to me. So far I've chosen to only wrap the Unicode APIs, so I don't yet have an opinion on the ANSI/UTF-8 APIs. Ideally I'd prefer not to expose both APIs -- in the same way that C allows you to set One obstacle I have with Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
We're using PWSTR and PSTR structs to wrap pointers to strings. They are defined as:
This lets a projection know that a field/parameter of this type is a string, and not just a pointer to a single char or byte. Now I need to do something about fixed-length strings that appear on structs. I can't use PWSTR and PSTR because these aren't pointers to strings--they are a fixed number of bytes which contain strings:
The W version isn't bad because "char" implies that it's a string, but ECMA-335 doesn't have an equivalent for single byte characters, so it's not obvious that WIN32_FIND_DATAA.cFileName is meant to contain single byte characters. The original definition for WIN32_FIND_DATAA uses CHAR which lets the developer know what the field is for:
I could make a new struct called CHAR and use it in places like WIN32_FIND_DATAA:
To the projection authors @kennykerr, @timsneath and @AArnott, what do you think?
Beta Was this translation helpful? Give feedback.
All reactions