I have a problem where my ✳ (Eight-Spoked Asterisk) symbol is converting to emoji on iOS/android devices..
Can somebody help me on what to do to prevent convertion of normal symbol ✳ to emoji asterisk! I am working with react/typescript.
Example:
I want 1234 ✳✳✳✳ ✳✳✳✳ 5678 – this is fine on desktop
I dont want 1234 1234 ✳️✳️✳️✳️ ✳️✳️✳️✳️ 5678 – this happens on ios/android
Thanks
EDIT – Function that does replacement:
JavaScript
x
6
1
export const hideDigits = (value: string) => {
2
const parsedValue = value.slice(0, 4) + value.slice(4, value.length -4).replace(/d/g,'u2733') + value.slice(value.length -4);
3
return (
4
normalizeVoucherCode(parsedValue)
5
);
6
};
Advertisement
Answer
Solved it like this for anyone who is wondering!
JavaScript
1
3
1
//Force ✳︎ to never be parsed as emoji with variation selector u{FE0E}!
2
const textSymbol = 'u{2733}u{FE0E}';
3