c/{entry.c,argv_entry.c,argv_source_entry.c} ignores non-utf8 characters in ARGV.
for (int i = 2; i < argc; i++) {
char* utf8 = mrb_utf8_from_locale(argv[i], -1);
if (utf8) {
mrb_ary_push(mrb, margv, mrb_str_new_cstr(mrb, utf8));
mrb_utf8_free(utf8);
}
}
What I concern about is, is it possible that cause inconsistency? That is undesired on blockchain. For example, Alice write a lock-script like
left = "我是个非UTF8的字符串"
hash = "12345678901234567890"
right = $UNLOCK_ARGUMENT[1]
return hash(left, right) == hash
Alice has to provide an unlock argument $UNLOCK_ARGUMENT, which meets the hash condition, to unlock the lock-script above. But since left is an non-utf8 string, the hash results of Alice computes offline and CKB-VM are difference. Then Alice has no way to unlock that script.
So, I think aborting for non-utf8 may be better here.
c/{entry.c,argv_entry.c,argv_source_entry.c} ignores non-utf8 characters in ARGV.
What I concern about is, is it possible that cause inconsistency? That is undesired on blockchain. For example, Alice write a lock-script like
Alice has to provide an unlock argument
$UNLOCK_ARGUMENT
, which meets the hash condition, to unlock the lock-script above. But sinceleft
is an non-utf8 string, the hash results of Alice computes offline and CKB-VM are difference. Then Alice has no way to unlock that script.So, I think aborting for non-utf8 may be better here.