parent
685d03e2e0
commit
881d1ee57b
1 changed files with 2 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ else:
|
||||||
WideCStringObj* = WideCString
|
WideCStringObj* = WideCString
|
||||||
|
|
||||||
template createWide(a; L) =
|
template createWide(a; L) =
|
||||||
unsafeNew(a, L * 4 + 2)
|
unsafeNew(a, L)
|
||||||
|
|
||||||
proc ord(arg: Utf16Char): int = int(cast[uint16](arg))
|
proc ord(arg: Utf16Char): int = int(cast[uint16](arg))
|
||||||
|
|
||||||
|
|
@ -138,8 +138,7 @@ iterator runes(s: cstring, L: int): int =
|
||||||
yield result
|
yield result
|
||||||
|
|
||||||
proc newWideCString*(source: cstring, L: int): WideCStringObj =
|
proc newWideCString*(source: cstring, L: int): WideCStringObj =
|
||||||
createWide(result, L * 4 + 2)
|
createWide(result, L * 2 + 2)
|
||||||
#result = cast[wideCString](alloc(L * 4 + 2))
|
|
||||||
var d = 0
|
var d = 0
|
||||||
for ch in runes(source, L):
|
for ch in runes(source, L):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue