From: Randy Lawrence Date: 2004-07-17T15:53:34+09:00 Subject: ext/dl problem with unsigned char* Hi, The string I pass to a c function does not appear to get modified if I use "unsigned char*" in ruby instead of plain "char*". Question 1: Is it wrong to pass a string object as a parameter which might contain non-ascii values when the c function returns? Qustion 2: The before and after values of 'inOut' remains the same unless the parameter type in line 4 is changed from "unsigned char*" to "char*". What can I do to fix this without resorting to Base64 encoding? module FooLib extend DL::Importable dlload './foolib.so.0' extern "int foo(unsigned char*, unsigned int)" #this line end inOut = 'original data' puts "before: #{inOut}" result = FooLib.foo(inOut, inOut.length) puts "after: #{inOut}"