I am working on a C binding and one of the methods returns a LibC::Char* (which under the covers is just a Pointer(UInt8)). It’s a regular null-terminated C string. I can’t figure out how to convert that to a Crystal String, so I can do things like String comparisons. I know I can do to_slice with the length, but then I have to know the length, however I have used that to verify that the contents are the bytes I expect.
So, how do I convert a Pointer(UInt8) to a String?
Thanks,
Jason
--
You received this message because you are subscribed to the Google Groups "Crystal" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crystal-lang...@googlegroups.com.
To post to this group, send email to crysta...@googlegroups.com.
Visit this group at https://groups.google.com/group/crystal-lang.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystal-lang/1189f977-1b7e-4218-bc83-1dbf5c161eaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.