-1

I am rewriting my app for iOS using react-native in order to support both Android and iOS platforms.
I have tried Realm as a database and have faced with lack of unicode support for react-native.
On iOS I used core data and everything was ok.

Are there any database for react-native with unicode support?
What is usual/useful pattern when introducing a database to a cross-platform mobile application? Should I add it on the highest level, for all platforms, or should I do it separately for each platform?

Update:
Realm team officially told me that there is no unicode support for react-native(https://forums.realm.io/t/issue-with-requests-containing-unicode-characters/994?u=spineight)

spin_eight
  • 3,925
  • 10
  • 39
  • 61
  • Not sure why you're facing errors with Realm as it definitely supports Unicode in its other platforms, and I don't see why the JavaScript version would be an exception. See [this question](https://stackoverflow.com/questions/44376002/) for options on storing data in your application. – sleighty Feb 26 '18 at 07:34
  • @BrunoEly hello I got official answer from Realm team that there is no support of unicode for react-native (https://forums.realm.io/t/issue-with-requests-containing-unicode-characters/994?u=spineight) – spin_eight Feb 26 '18 at 10:35
  • oh that's really interesting, I must have missed it under limitations... Still there's plenty of options out there that do support Unicode (see the question I linked) like SQLite for example – sleighty Feb 26 '18 at 23:17
  • @BrunoEly are you sure that SQLite supports unicode? No info about it in official site, I have put request for that. My idea is to make sure from official source that unicode is supported when start implementation in order to reduce time spent for that. I have looked through this list many times before, unfortunately there are no info whether unicode is supported that is why I posted this question – spin_eight Feb 26 '18 at 23:32

1 Answers1

0

From the link you shared, Unicode is in fact supported by Realm, although it does not support case insensitive matching for characters outside of the range UTF-8 0–591:

  1. String sorting and case insensitive queries are only supported for character sets in ‘Latin Basic’, ‘Latin Supplement’, ‘Latin Extended A’, ‘Latin Extended B’ (UTF-8 range 0-591).

As long as you set the encoding to UTF-8 in SQLite, it should let you use SQL LIKE statements, with the help of the UPPER() and LOWER() functions, to do case-insensitive comparing (although the same effect can potentially be achieved in JavaScript and Realm). See this.

sleighty
  • 895
  • 9
  • 29