Bug 8792, fix for collation key creation.

This commit is contained in:
nhotta%netscape.com 1999-07-14 17:01:34 +00:00
Родитель 1dbffc0d51
Коммит d7274eb0a9
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -129,7 +129,10 @@ nsresult nsCollation::CreateSortKey(nsICollation *inst, const nsCollationStrengt
if (nsnull != aKey) {
res = inst->CreateRawSortKey(strength, stringIn, aKey, &aLength);
if (NS_SUCCEEDED(res)) {
key.SetString((PRUnichar *) aKey, aLength / sizeof(PRUnichar));
// set as char* makes every byte to be casted to PRUnichar
// which doubles the key size, use CreateRawSortKey instead
// to avoid this to happen
key.SetString((char *) aKey, aLength / sizeof(char));
}
delete [] aKey;
}

Просмотреть файл

@ -57,7 +57,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale)
mCharset.SetString("ISO-8859-1"); //TODO: need to get this from locale
// store platform locale
mLocale.SetString("en_US");
mLocale.SetString("C");
if (locale != nsnull) {
nsString aLocale;