I'm sorry, I meant to use 'magic', not the pointer to it:
wxString strSearchResults;
wxFile tempFile;
if(tempFile.Open(wxT("SearchResults.txt"), wxFile::write))
{
unsigned char magic[2] = {0xFF, 0xFE};
tempFile.Write(magic, 2); // <-- was wrong in my previous post
tempFile.Write(strSearchResults);
tempFile.Close();
}