2

I'm collecting data from users' devices for analytics. I've got some final static Strings representing event names (e.g. "banner_click"). As the appropriate event occurs the event name gets stored in sqlite database, after which I periodically read them from DB into JsonObject and make HTTP request to send the collected data to our server, but sometimes we get corrupted event names ("banner_clıck" instead of "banner_click", "i" is replaced with "ı" in all such cases). This case happens rarely, but it worries me. So I'd like to know how come constant string be corrupted, I cannot reproduce it myself. My only guess for now is that it's a device specific issue.

mdavid
  • 563
  • 6
  • 20

1 Answers1

4

The i in your click is actually ı i.e. LATIN SMALL LETTER DOTLESS I. The UTF-8 for it is 0xc4 0xb1 and interpreting those bytes as ISO-8859-1 gives the ı.

  1. Fix the character to be a regular i.

  2. Mind your character encoding when dealing with non-ASCII.

laalto
  • 150,114
  • 66
  • 286
  • 303
  • Exactly how should I fix the character to be regular i ? I just have class with defined String constants. And why doesn't it happen constantly if there's a such issue? – mdavid Apr 08 '15 at 13:06
  • You most likely have the dotless i somewhere in your code. – laalto Apr 08 '15 at 13:07
  • You described the most probable case, but I cannot find any dot less "i" in my code I don't know how I could even type that. I'm checking my keyboard's "i" and it gets interpreted like "U+0069" which is normal dotted lowercase "i". – mdavid Apr 08 '15 at 13:48