ERR_FAIL_COND_V_MSG(err,err,"Cannot open TextFile '"+p_path+"'.");
uint64_tlen=f->get_len();
sourcef.resize(len+1);
PoolVector<uint8_t>::Writew=sourcef.write();
uint64_tr=f->get_buffer(w.ptr(),len);
f->close();
memdelete(f);
ERR_FAIL_COND_V(r!=len,ERR_CANT_OPEN);
w[len]=0;
Strings;
ERR_FAIL_COND_V_MSG(s.parse_utf8((constchar*)w.ptr()),ERR_INVALID_DATA,"Script '"+p_path+"' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode.");