Domanda

I have following Smartclient JS code, which doesn't render UTF-8 characters properly in UI

function getGridLoadedWithDatasource(DS, DSfields) {

var statGrid = isc.ListGrid.create({
    ID: "statusGrid",
    autoFetchData: true,
    fields: DSfields,
    dataSource: DS,
    canEdit: false,
    autoDraw: true,


    showRecordComponents: true,    
    showRecordComponentsByCell: true, 

    createRecordComponent : function (record, colNum) {  
                                var fieldName = this.getFieldName(colNum);
                                if (fieldName == "btnClaim" && record["PTicketname"]=='Reklamacija') {  
                                    var button = isc.IButton.create({
                                        height: 18,
                                        width: 65,
                                        //icon: "flags/16/" + record["countryCode"] + ".png",
                                        title: "Žalba",
                                        click : function () {
                                            //alert("Hello man!");
                                            isc.say("Need to draw a form here");
                                            //getInvoiceDetailWindow(record["rednibr"],tech, ba_id);

                                        }
                                    });
                                    return button;  
                                } 
                            }
});
return statGrid;

}

The word that I use for title gets broken on UI. How and where do I enable/configure UTF-8 for smartclient widgets?

Best Regards!

È stato utile?

Soluzione

If you use special characters as literals in your Javascript code you'll have to make sure that the Javascript source code has the same character encoding as your main page. In Notepad++ for example you should set it to UTF-8 using the menu "Encoding / UTF-8 without BOM" or similar.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top