Okay, this seems to work great for converting pointers to Nim strings:
    
    
    proc fromCString(p: pointer, len: int): string =
      result = newStringOfCap(len)
      var lowLevel = cast[cstring](p)
      for i in 0 ..< len:
        var character: char = lowLevel[i]
        add(result, character)
    

Many thanks to the individuals who contributed in this thread!

Reply via email to