Sunday, 25 August 2019

Arabic text not rendered correctly (rendered as rubbish)

I am working on a react-native app and I have a problem when rendering some Arabic text that returned from API most of the times the text looks like rubbish (check screenshot 1)

And for a few times, it rendered correctly (check screenshot 2)

screenshot 1 screenshot 1

screenshot 2 screenshot 2

I checked the API response and it always returns the text correctly.

FYI I am using axios to fetch the data.

below you can find the render method that I am using:

renderVisitorName(firstName,lastName) {
      return (
        <Text style={styles.name}>
          {firstName + " " + lastName}
        </Text>
      );
}

I am only testing this on Android.



from Arabic text not rendered correctly (rendered as rubbish)

No comments:

Post a Comment