views:

118

answers:

0

OK, so my datasource is serving json and it's UTF8 encoded. Viewing the json result in the browser or Firebug confirms this. But when the YUI datatable displays the results in a table the UTF encoding is lost, resulting in G�teborg instead of Göteborg

I see according to the documentation provided by Yahoo that you can specify the connection manager to use UTF8 when posting data but I don't see anything about get's over XHR.

var myDataSource = 
    new YAHOO.util.DataSource("crudYuiSqlService.rsb?@fmtoptions=exparen&@json&");
    myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
    myDataSource.connMethodPost = true;
    myDataSource.responseSchema = {
        resultsList: "items",
        fields: \[{
            key: "phone",
            parser: "string"
        }, {
            key: "city",
            parser: "string"
        }, {
            key: "contacttitle",
            parser: "string"
        }, {
            key: "companyname",
            parser: "string"
        }]
    };