couchbaselabs/TouchDB-iOS — Issue #4: View collation doesn't sort non-ASCII characters correctly
Author: snej
Created: 2011-12-18 17:53:11+00:00
State: open
Labels: bug

The collation/sorting of keys in views currently ignores Unicode issues: to compare JSON strings it just does a dumb binary compare of UTF-8 data.

The function that needs to be fixed is compareStrings() in TDCollateJSON.m. It should probably check for non-ASCII characters as it does its current fast scan; if it finds one it should stop the scan, convert both strings to CFStringRefs and use a proper CFString function to compare them.