Inconsistent behavior in localeCompare
Georgezxh opened this issue · 2 comments
Georgezxh commented
JerryScript revision
2.4.0
Description
'a' is before 'A', so the first result should be negative number.
When adding parameter{ sensitivity: 'base' }
, 'a' should be equal 'A', so the second result should be 0.
Test case
var a = 'a';
var b = 'A';
print(a.localeCompare(b));
print(a.localeCompare(b, 'en', { sensitivity: 'base' }));
Output
1
1
Expected behavior
-1(Or other negative number)
0
matetokodi commented
Fixing this would require the use of libICU
or a similar library for proper unicode and locale support, which would increase the size of the jerryscript binary substantially, and as such it will not be done.
zherczeg commented
An icu would increase the library size too much.