Dear acrobat scripters,
I have a Acrobat 9 Pro javascript in a test form which retrieves all database tables ordered by creation date. The result of this query feeds a combobox within the form.
For some strange reason the table names are returned within acrobat in strange Chinese/Japanese characters and I’m clueless why that is. Previous to this I had the same thing with the values of a column which showed the same Chinese/Japanese characters in a text field. I solved that problem by changing the column collation from utf8_general_ci to latin1_swedish_ci. Don’t ask me why this solved the problem.
If I run the (MySQL) query within my phpadmin everything’s fine.
Anyone a suggestion?
Database: MySQL 5.1.36
MySQL character set: UTF-8 Unicode (utf8)
PS. I know ADBC is dropped in Acrobat X.
*My testcode*
var cb = this.getField("combobox_projectnr");
var adbcConnection;
var adbcConnectionStatement;
var tableArray = new Array;
var sortedArray = new Array();
if(formDebug == true) {
//this.getField("stickernr_input").value = "";
//this.getField("combobox_bouwlaag").value = "Maak een selectie";
populateCombobox();
}
else {
populateCombobox();
}
function populateCombobox() {
try {
adbcConnection = ADBC.newConnection("pdfTest","root","");
//
if (adbcConnection == null) {
console.println("Geen verbinding met de database.");
}
else {
//console.println("getTables functie");
getTables();
}
}
catch(e) {
console.println("Helaas is er een fout opgetreden: "+e);
}
}
function getTables() {
adbcConnectionStatement = adbcConnection.newStatement();
tableArray = adbcConnection.getTableList();
sortByCreationDate();
}
function sortByCreationDate() {
var getDate = "SELECT table_name AS projectnummer FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='vanwaning' ORDER BY create_time ASC";
try {
adbcConnectionStatement = adbcConnection.newStatement();
adbcConnectionStatement.execute(getDate);
cb.clearItems();