0
这里是我的test file引发ArgumentError:字符串包含空字节时使用StringValueCStr
这里是我的全部代码(github.com/roroco/ro_article/tree/string-contains-null-byte)
我得到“引发ArgumentError:字符串包含空字节的” 运行时下面的代码:在红宝石侧
:
get_article(File.read("test_file"))
在C端:
VALUE get_article(VALUE self, VALUE html) {
str html2 = StringValueCStr(html);
test file这么大,如何在这个文件中找到空字节?如何使StringValueCStr工作的所有字符串,即使它包含“空字节”