How to export the data with the character set specified. I know the export dialog within Servoy has an option to specify the character set but don’t know how to do with the scripts
Can some one give me some thoughts on this?
Below is the code I use to export. Currently when I export foreign characters using this, the output is only with the questions marks (???)
var frmObj = forms.homeList;
var totalRecords = databaseManager.getFoundSetCount(frmObj.foundset);
globals.exportText = "";
for ( var i = 1 ; i <= totalRecords; i++ ) {
var currentRecord = frmObj.foundset.getRecord(i);
globals.exportText += currentRecord['chi_title'] + "\n";
}
var success = plugins.file.writeTXTFile("C:/test.txt",globals.exportText);
I need to write a text file with the encoding Western (Windows Latin 1) on a Mac. As you say the File plug-in now has the optional parameter [charsetname]. But what name to use? Where can I get the list of encoding/charset names? Where can I get the below mentioned sample code?
Move the sample code in the editor for the plugin function read or writeTxt file, you will see it contains a link to a page from SUN which contains the names to use for different en/decoders.
Jan Blok:
Move the sample code in the editor for the plugin function read or writeTxt file, you will see it contains a link to a page from SUN which contains the names to use for different en/decoders.