By looking over the Google Search results that I suggested above I find the following:
func utf8encode( lcString )
local lcUtf, i
lcUtf = ""
for i = 1 to len(lcString)
c = asc(substr(lcString,i,1))
if c < 128
cUtf = cUtf+chr(c)
else
cUtf = cUtf+chr(bitor(192,bitrshift(c,6)))+chr(bitor(128,bitand(c,63)))
endif
next
return cUtf
Note: That is not my own code and I have not tested it, but the poster on the other site indicated that it worked in the OLD version of Foxpro they were using.
Also it wouldn't surprise me much if the code needed modification to work for you.
EDIT: Obviously that code is just a FUNCTION() which would receive the intended String and then convert it to UTF8.
Once done, it would return the string to the calling routine which would then need to convert the String into a File using VFP's STRTOFILE() function.
Alternatively, if you were using VFP9 you could use STRCONV() for the String conversion.
STRCONV( ) Function
Good Luck