Skip to Content

SAP UI5, unicode and national (non-ASCII) characters

Dear collective wisdom,

I'm fighting against what looks like a potentially silly issue since too long, so I decided to bother this community and ask for your informed help.

We've started developing a solution on SAP Cloud Platform since just a few months and having a strange issue.

Our solution (written in JavaScript and running natively on the SAP Cloud Platform) calls the Facebook API using web services written and run as .xsjs code; the Facebook API returns specific posts, potentially in non-english languages (German and its ä, ö, ü, ß is very common).

We then reads the returned JSON objects, transform them with .asString() and JSON.parse() them before writing the posts and a few values in HANA tables.

Everything works perfectly with English, it is NOT working with all non-ASCII characters, thou.

When we display the posts in SAP UI5 using GenericTile and sap.m.Text content, we always get "corrupted" non-ASCII characters, i. e. in a form similar to: "Wusstest du, dass der lateinische Name von Rosmarin �Tau des Meeres� bedeutet? Dieser poetische Name kommt von der Herkunftsregion des aromatischen Strauchs, dass vor allem an den Küsten des Mittelmeeres wächst."

Of course our index.html includes:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

We've tried pretty much everything possible, so I'd be really grateful for anybody pointing us in the right direction...

Thank you in advance,


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Mar 14, 2017 at 06:27 PM

    Dear collective wisdom,

    thanks to the kind help of a SAP HANA distinguished engineer (@robin.vanhethof) I was led to look at the problem from a different angle.

    If SAP UI5 is perfectly able to automatically deal with Unicode characters and my text data looked perfectly OK in HANA table fields, wasn't possibly the problem the function [ getString() ] I was using to read data from HANA fields? Yep, that was it!

    Reading this older conversation, it turns out that getString() should be used for ASCII only fields, for more complex text fields (i. e. non-ASCII) getNString() should be used.

    Problem solved!


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 14, 2017 at 03:53 PM

    Hi Luca,

    JSON is always encoded as UTF-8 ( so that shouldn’t be the issue.

    Also, SAPUI5 is perfectly capable of displaying UTF-8 diacritics (see this small example:,js,output)

    Only two things I can think of right now:

    1. Can you check whether the JSON data stored in your HANA tables has the correct encoding?
    2. Can you check whether the data retrieved from HANA into your SAPUI5 app has the correct encoding?
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.