%module javascript_unicode %newobject copy_string; %inline %{ #include const char* copy_string(const char* str) { return strdup(str); } %}