Depends what the character encoding is of the string pFileToDelete
. If you don't know, then you need to find out (or define it yourself).
Assuming that it's 7-bit ASCII, then
TPtr8 wrapper(pFileToDelete, User::StringLength(pFileToDelete));
{
TFileName name;
name.Copy(wrapper);
error = fs.Delete(name);
}
Braces are there just because TFileName is quite a large class (512 bytes or so, IIRC), so you want to be slightly wary about putting one on the stack, and give it the smallest scope possible. You could heap-allocate instead.
If it's UTF-8, then there is more work to do, check out ConvertToUnicodeFromUTF8
in class CnvUtfConverter
.
It's usually better to define your filename as a descriptor literal in the first place, if you can.