I'm currently experiencing a strange bug on my device: Whenever an apostrophe (') would be displayed, it shows an ampersand (&) instead, and the rest of the text that would be after the apostrophe is cut.

This only happens in one app, but the app is not the problem, as it doesn't happen in my friends's phones, I even tried installing the app on an emulator and it works fine.

I'm using a Xiaomi Mi A2 Lite, it's got Android One and is up to date (Android 9, Jan 5 patch), no custom roms or anything.

On the left, how it looks in my phone; and on the right, how it should look.


UPDATE: After tinkering with the database I found out that the text that is being displayed is actually stored in html format that is latter interpreted and rendered by the application.

Also, these apostrophes are being stored as a numeric character reference (&#39 ;) which leads me to believe that the ampersand I'm seeing is actually the first character of the NCR.

I still don't understand why is this happening though, as the rest of the html code is being interpreted correctly.

  • Both characters are important in software and need to be "escaped" so the code knows whats something to calculate and whats something to show (simplified). I suspect I know whats going on here. A: ' B: ʹ - These look the same or similar but are not. If the app dev included an apostrophe look alike Xiaomi may not have handled it properly. With english as a 2nd language they are less likely to spot such nuances. If rooted you can try a different font just in case, if not its something for Xiaomi to patch out. – Linef4ult Feb 7 '19 at 1:40
  • @Linef4ult I don't have the phone rooted so I can't try that. Also I don't have access to the app source code, but I do have access to the database where the text is stored and the apostrophes causing the problem are standard apostrophes (U+0027). – Lekgolo137 Feb 7 '19 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.