Writing a UTF8 text file to server.

Tim Selander selander at tkf.att.ne.jp
Thu Oct 4 01:22:23 EDT 2018


I am using Livecode Server on Livecode's hosting plan.

Taking my first stab at a web response form. I am getting the data from 
$_POST fine, and when I simply do something like:
put $_POST[firstname]

the UTF8/Kanji word shows up fine in the webpage. But I am unable to 
save the data to a file on the server encoded in UTF8 (simply trying to 
collect the submitted data).

put "data.txt" into vfile
open file vfile for utf8 text update
put $_POST[firstname] & comma & $_POST[lastname] & comma & 
$_POST[country] &  the time & return into vdata
write vdata to file vfile at end
close file vfile

Data is getting saved, but in gibberish, not in kanji/utf8.

Anyone see what I'm doing wrong?

TIA

Tim Selander
Tokyo, Japan





More information about the use-livecode mailing list