Quantcast
Channel: SCN : All Content - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6745

XSJS Charset problem on SP9

$
0
0

Hi Experts,

 

I'm executing a simple select inside a xsjs service, and after, returning the result in a json format. All works fine, except that, after SP9 (rev 93) upgrade, the charset is no longer working. See below:

 

Table PEOPLE:

Name | Surname

João | Silva

 

Here the XSJS file:

 

$.response.contentType = 'application/json; charset=utf-8'; 

var conn = $.db.getConnection();

var pstmt = conn.prepareStatement( 'select * from "PEOPLE"' );

var rs = pstmt.executeQuery();

 

var jsonArr = [];

while (rs.next()){

    jsonArr.push({

        name: rs.getString(1),

        suname: rs.getString(2)

    });

}

rs.close();

pstmt.close();

conn.close();

 

$.response.setBody(JSON.stringify(jsonArr));

$.response.status = $.net.http.OK;

 

When running SP8, the result was the following:

 

[

-{
name: "João",
suname: "Silva"
}

]


Now running SP9, the result is:


[

     -{

name: "João",
suname: "Silva"
}

]


Do you know how can I solve this?


Thanks and regards,

Roberto Falk


Viewing all articles
Browse latest Browse all 6745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>