0

how do I sort the retrieved data from the database to be displayed as the testing data listed below if there are special characters as the à character?

  1. Apple
  2. ÃTest
  3. Ãbc

Currently this is what I have

query(mDBOpenHelper.getReadableDatabase(), columnList,selection,selectionArgs, null, null, TestDBOpenHelper.COLUMN1)

When I tested the it on my device, it will display those below after the alphabet Z.

  1. ÃTest
  2. Ãbc

Could someone please teach me how do I fix this? thank you very much

NickT
  • 23,183
  • 11
  • 76
  • 115
AuroraBlaze
  • 351
  • 2
  • 6
  • 24

1 Answers1

0

As i know, you won't be able to work with such characters in SQLite as UNICODE,BINARY and LOCAlIZED are the only collation ways to use in sorting. but you can make a work around this. refer to this How to ignore accent in SQLite query (Android)

Community
  • 1
  • 1
Ahmed Zayed
  • 2,115
  • 1
  • 17
  • 20
  • I had tried putting this COLLATE NOCASE into the order by , but still it doesn't seem to work T^T – AuroraBlaze Mar 16 '14 at 07:44
  • Collate won't make it work as it will use the default collation in this case which is BINARY collation. you have to handle it your own way. check the link i posted, i think it's a good work around – Ahmed Zayed Mar 16 '14 at 07:47