Re: [Factor-talk] Turning a string into a char-array for C

2015-03-02 Thread John Benediktsson
You could do something like this to get a byte array to pass to the function if passing a string doesn't work: IN: scratchpad "hello" utf8 encode . B{ 104 101 108 108 111 } Other encodings are available, like ascii or utf16, etc.. On Mon, Mar 2, 2015 at 10:15 AM, Mark Green wrote: > H

Re: [Factor-talk] Turning a string into a char-array for C

2015-03-02 Thread Mark Green
Hi, Thanks for the note. However I am not writing the function declaration myself, I'm using the ones provided in extra.gtk.ffi. Can I use encode to roll my own into the char-array type? Mark -- Dive into the World of Par

Re: [Factor-talk] Turning a string into a char-array for C

2015-03-01 Thread John Benediktsson
The c-string type handles encoding and decoding to a known encoding like UTF8 which is the default I think. See the "encode" and "decode" words for under the covers how it works. > On Mar 1, 2015, at 3:55 PM, Doug Coleman wrote: > > Hi Mark, > > You can try using the ``c-string`` type in a

Re: [Factor-talk] Turning a string into a char-array for C

2015-03-01 Thread Doug Coleman
Hi Mark, You can try using the ``c-string`` type in a C function declaration in lieu of a ``char*``. I think it will do what you need. Doug On Sun, Mar 1, 2015 at 3:46 PM, Mark Green wrote: > Hi, > > If I want to turn a string into a char-array type to use the GTK library > with it, is there