add isvalid_ref
add unicode ref test