Ok, thanks.

My final solution for 1st problem:

in userimg.jl I have added this line:

demo(x::Vector{UInt8}) = println("x: ", utf8(x))

and in start_func.c I have this code:

#include <julia.h>
#include <stdio.h>
int main()
{
jl_init_with_image(NULL, "libMyJuliaImage.dll");
        int utf8_length = 6;
jl_value_t* array_type1 = jl_apply_array_type(jl_uint8_type, 1);
jl_array_t* utf8_str = jl_alloc_array_1d(array_type1, utf8_length);
        JL_GC_PUSH1(&utf8_str);
        char* data = jl_array_data(utf8_str);
        data[0] = 'H';
        data[1] = 'E';
        data[2] = 'L';
        data[3] = 'L';
        data[4] = 'O';
        data[5] = '!';
        jl_function_t *func  = jl_get_function(jl_current_module, "demo");
        jl_call1(func, (jl_value_t*) utf8_str);
        JL_GC_POP();
        int ret_val = 0;
        jl_atexit_hook(ret_val);
        return ret_val;
}

In C I work with uint8(char) array without '\0' and in julia i need convert 
this array with utf8() function. 



Reply via email to