You are using a (deprecated) function improperly, which is why you are seeing an error dialog. Try instead:
tCharsWritten = PRegEx_WriteStringToFile(_movie.path & "MyText.txt", [member("content").text], "UTF-8") if tCharsWritten < 0 then -- an error occurred alert "Error writing string:" && PRegEx_DescribeError(tCharsWritten) end if
When I save the txt file and open it back again into a text member, words containing characters such as á ú ó é are messed-up like:
Ã© Ã¡ Ã³n
I'm loading the file using this:
myFile = PregEx_ReadEntireFile(_movie.path & "Mytext.txt", "UTF-8")
member("mytext").text = string(myFile)
What am I doing wrong?
Perhaps you could try "CP1252FULL" instead of "UTF-8" as the text encoding
YES! it works. Thank you so much, Sean.