diff options
author | Stephen Kitt <skitt@debian.org> | 2016-05-27 10:11:04 +0200 |
---|---|---|
committer | Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com> | 2016-05-27 14:28:33 +0100 |
commit | 752fd7247bc223bcea35bd89cf56d1c08ead9ba6 (patch) | |
tree | b4a428f847a963738faaf24c8eff070fdb03a3a5 /lib/unistr/u-strcoll.h | |
parent | 9f7d4fa477ff2a51d7c932b13d57ac22dc033105 (diff) | |
parent | a9a31b1de5776a3b08a82101a4fa711294f0dd1d (diff) |
Imported Debian patch 0.9.6+really0.9.3-0.1debian/0.9.6+really0.9.3-0.1
Diffstat (limited to 'lib/unistr/u-strcoll.h')
-rw-r--r-- | lib/unistr/u-strcoll.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/unistr/u-strcoll.h b/lib/unistr/u-strcoll.h index 014e11b..9ec5c60 100644 --- a/lib/unistr/u-strcoll.h +++ b/lib/unistr/u-strcoll.h @@ -1,6 +1,6 @@ /* Compare UTF-8/UTF-16/UTF-32 strings using the collation rules of the current locale. - Copyright (C) 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2009-2010 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it @@ -23,19 +23,14 @@ FUNC (const UNIT *s1, const UNIT *s2) When it fails, it sets errno, but also returns a meaningful return value, for the sake of callers which ignore errno. */ int final_errno = errno; - const char *encoding = locale_charset (); char *sl1; char *sl2; int result; - /* Pass iconveh_error here, not iconveh_question_mark. Otherwise the - conversion to locale encoding can do transliteration or map some - characters to question marks, leading to results that depend on the - iconv() implementation and are not obvious. */ - sl1 = U_STRCONV_TO_ENCODING (s1, encoding, iconveh_error); + sl1 = U_STRCONV_TO_LOCALE (s1); if (sl1 != NULL) { - sl2 = U_STRCONV_TO_ENCODING (s2, encoding, iconveh_error); + sl2 = U_STRCONV_TO_LOCALE (s2); if (sl2 != NULL) { /* Compare sl1 and sl2. */ @@ -46,10 +41,10 @@ FUNC (const UNIT *s1, const UNIT *s2) /* strcoll succeeded. */ free (sl1); free (sl2); - /* The conversion to locale encoding can drop Unicode TAG - characters. Therefore sl1 and sl2 may be equal when s1 - and s2 were in fact different. Return a nonzero result - in this case. */ + /* The conversion to locale encoding can do transliteration or + map some characters to question marks. Therefore sl1 and sl2 + may be equal when s1 and s2 were in fact different. Return a + nonzero result in this case. */ if (result == 0) result = U_STRCMP (s1, s2); } @@ -73,7 +68,7 @@ FUNC (const UNIT *s1, const UNIT *s2) else { final_errno = errno; - sl2 = U_STRCONV_TO_ENCODING (s2, encoding, iconveh_error); + sl2 = U_STRCONV_TO_LOCALE (s2); if (sl2 != NULL) { /* s2 could be converted to locale encoding, s1 not. */ |