0

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!

azec-pdx
  • 4,790
  • 6
  • 56
  • 87

1 Answers1

2

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.

devnull69
  • 16,402
  • 8
  • 50
  • 61
  • I was pretty sure this was not the error. However I converted remote file with Sublime Text editor to UTF-8 encoded file and it turned out working. – azec-pdx Dec 06 '12 at 09:42