For my case, I need to copy a region of UTF-16 text from the heap into a Text. It is NULL (U+0000) terminated.
Currently I'm scanning each 16-bit code unit in a loop to detemine the length and then calling Data.Text.Foreign.fromPtr, but I wonder if an easier method can be provided.
For my case, I need to copy a region of UTF-16 text from the heap into a
Text. It is NULL (U+0000) terminated.Currently I'm scanning each 16-bit code unit in a loop to detemine the length and then calling
Data.Text.Foreign.fromPtr, but I wonder if an easier method can be provided.