I'm trying to generate a CSV UTF-8 with Livecode.
I use CSV with an Adobe Illustrator plugin to generate variable data printing.
Using Excel's "CSV UTF-8" saving option, everything works correctly for French characters accents.
However, I can't generate a CSV with accents that is recognized by my plugin, when I do it with Livecode.
The file generated with Livecode is correctly displayed with accents in TextEdit on the Mac.
When I import it into the Illustrator plugin, it's always recognized with a "Western Europe (Windows)" encoding, and the accents are not managed.
The same file imported into Excel and saved as a CSV UTF-8 file is recognized with a "UNICODE" encoding and the accents are managed.
How can I generate a CSV in livecode with "UNICODE" encoding?
Here is my code :
Code: Select all
on mouseUp pMouseButton
put "NOM;ENTREPRISE;TEXTE" & CR into tVariable
put "Matthieu;Garage;Hespéridée" after tVariable
ask file "Choisissez la destination de l'export" with "BD_test"
if the result is not "cancel" then
put it into tFileName
put textencode(tVariable,"UTF-8") into tVariable
put tVariable into URL ("file:" & tFileName & ".csv")
end if
end mouseUp