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工作的所有字符串,即使它包含「空字節」