Narendra
Narendra

Reputation: 4574

Apostrophe in NativeScript App name is not working for Android/ios deployment

I am working on a NativeScript App and I want to publish that APP on google play store with an apostrophe('s) in it's Name e.g. Naren's App. It is working fine on ios as I have to change info.plist file as described in this example. But for Android it is trimimng the name after ('s) and it is deployed on device/emulator as Naren not Naren's App.

Here is the code in my AndroidManifest.xml

<application
        android:name="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

and in strings.xml(in values and values-v21 folder)

<resources>
    <string name="app_name">Naren's Orders Dev</string>
    <string name="title_activity_kimera">Naren's Orders Dev</string>
</resources>

Has anyone experienced it before?

Upvotes: 0

Views: 498

Answers (1)

Narendra
Narendra

Reputation: 4574

I found the solution on android resources here. They say

Handle special characters

When a string contains characters that have special usage in XML or Android, you must escape the characters. Some characters can be escaped by using a preceding backslash, while others require XML escaping. Apostrophes and single quotes can also be handled by enclosing the entire string in double quotes. Some examples are shown below:

Single quote (')
Any of the following:

&apos;

\'

Enclose the entire string in double quotes ("This'll work", for example)

I have tried with &apos; first but that was not working but \'s is working. Posting it here as it may be useful for others.

EDIT:

&apos; is working with ios but it is trimming down white space for that Replace normal space with unicode &#x2007;

Upvotes: 2

Related Questions