Skip to content

Commit

Permalink
fix: add reference comments, etc.
Browse files Browse the repository at this point in the history
to code & documentation

- add references for EU character mappings
  - mobilexag/cordova-sqlite-evplus-ext-free#21
  - storesafe/cordova-sqlite-evcore-extbuild-free#50 (comment)
- add reference to cordova-sqlite-storage test suite from:
  - https://github.com/storesafe/cordova-sqlite-storage/tree/6.0.0/spec
- update documentation of known issue with SELECT LOWER_EU(9e999) &
  SELECT LOWER_EU(-9e999)
  • Loading branch information
Christopher J. Brody committed Jun 10, 2022
1 parent f6a5892 commit a1d0e64
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ int main() {
- `cc test.c sqlite3.c sqlite3_eu.c -o test`
- `./test`
## Known quirks
## Known mapping issue
- Statements such as `SELECT LOWER_EU(9e999)` return results like `ınf`
## References
- https://github.com/mobilexag/cordova-sqlite-evplus-ext-free/issues/21
- https://github.com/storesafe/cordova-sqlite-evcore-extbuild-free/issues/50#issuecomment-498858058
- cordova-sqlite-storage test suite ref:
- https://github.com/storesafe/cordova-sqlite-storage/tree/6.0.0/spec
8 changes: 8 additions & 0 deletions sqlite3_eu.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ void init_map() {
}
}

// references:
// - https://github.com/mobilexag/cordova-sqlite-evplus-ext-free/issues/21
// - https://github.com/storesafe/cordova-sqlite-evcore-extbuild-free/issues/50#issuecomment-498858058
EU_MAP_ENTRY(0x00E4, 0x00C4);
EU_MAP_ENTRY(0x00E0, 0x00C0);
EU_MAP_ENTRY(0x00E1, 0x00C1);
Expand Down Expand Up @@ -74,6 +77,11 @@ void init_map() {
EU_MAP_ENTRY(0x00ED, 0x00CD);
EU_MAP_ENTRY(0x00EE, 0x00CE);
EU_MAP_ENTRY(0x00EF, 0x00CF);
// XXX TODO: NEED ONE-WAY MAPPING FOR U+0131 -> U+0049
// TO AVOID KNOWN ISSUE WITH SELECT LOWER_EU(9e999)
// OR SELECT LOWER_EU(-9e999)
// see cordova-sqlite-storage test suite ref:
// - https://github.com/storesafe/cordova-sqlite-storage/tree/6.0.0/spec
EU_MAP_ENTRY(0x0131, 0x0049);
EU_MAP_ENTRY(0x012B, 0x012A);
EU_MAP_ENTRY(0x012F, 0x012E);
Expand Down
6 changes: 5 additions & 1 deletion test.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ int main() {
sqlite3_exec(db, "SELECT UPPER_EU('đ ď ð abc')",
assert_result_matches, "Đ Ď Ð ABC", NULL);

// TBD STRANGE RESULT for this operation:
// XXX TODO KNOWN ISSUE:
// TBD STRANGE RESULT for this operation,
// see cordova-sqlite-storage test suite ref:
// - https://github.com/storesafe/cordova-sqlite-storage/tree/6.0.0/spec
TESTLOG("SELECT LOWER_EU(9e999)");
sqlite3_exec(db, "SELECT LOWER_EU(9e999)",
assert_result_matches, "ınf", NULL);

// XXX TODO KNOWN ISSUE:
// TBD STRANGE RESULT for this operation:
TESTLOG("SELECT HEX(LOWER_EU(9e999))");
sqlite3_exec(db, "SELECT HEX(LOWER_EU(9e999))",
Expand Down

0 comments on commit a1d0e64

Please sign in to comment.