Nim support for C/C++’s wide strings.
Types
Utf16Char = distinct int16
WideCString = ref UncheckedArray[Utf16Char]
WideCStringObj = WideCString
Procs
proc `$`(s: WideCString): string {....raises: [], tags: [], forbids: [].}
proc `$`(w: WideCString; estimate: int; replacement: int = 0x0000FFFD): string {.
...raises: [], tags: [], forbids: [].}
proc len(w: WideCString): int {....raises: [], tags: [], forbids: [].}
returns the length of a widestring. This traverses the whole string to find the binary zero end marker! Source Edit
proc newWideCString(s: cstring): WideCStringObj {....raises: [], tags: [],
forbids: [].}
proc newWideCString(s: string): WideCStringObj {....raises: [], tags: [],
forbids: [].}
proc newWideCString(size: int): WideCStringObj {....raises: [], tags: [],
forbids: [].}
proc newWideCString(source: cstring; L: int): WideCStringObj {....raises: [],
tags: [], forbids: [].}