CR 7090689 - fix transliteration, codeset detection by uconv
authorpavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
Fri, 11 Nov 2011 11:24:48 +0100
changeset 85 de8b1a6f312b
parent 84 da5274f11060
child 86 0461312d873a
CR 7090689 - fix transliteration, codeset detection by uconv
icu/icu.spec
icu/patches/source_common_putil.c.patch
--- a/icu/icu.spec	Mon Oct 03 09:38:40 2011 +0200
+++ b/icu/icu.spec	Fri Nov 11 11:24:48 2011 +0100
@@ -51,6 +51,9 @@
 Patch25: source_common_testdata_conversion.txt.patch
 Patch26: source_test_ccapitst.c.patch
 Patch27: source_i18n_decNumber.h.patch
+#fix codeset detection in uconv, this fixes transliteration e.g. Greek-Latin
+#see CR 7090689, ICU bug 8891
+Patch28: source_common_putil.c.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}
 SUNW_Copyright: %{src_name}.copyright
@@ -97,6 +100,7 @@
 %patch25 -p1
 %patch26 -p1
 %patch27
+%patch28
 
 %ifarch amd64 sparcv9
 cd ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icu/patches/source_common_putil.c.patch	Fri Nov 11 11:24:48 2011 +0100
@@ -0,0 +1,33 @@
+--- source/common/putil.c	Wed Oct 27 00:02:14 2010
++++ source/common/putil.c	Tue Nov  8 16:24:55 2011
+@@ -1391,9 +1391,18 @@
+         {
+             /* Maybe we got some garbage.  Try something more reasonable */
+             posixID = getenv("LC_ALL");
++            /* Solaris speaks POSIX -  See IEEE Std 1003.1-2008 
++             * This is needed to properly handle empty env. variables
++             */
++#if defined(U_SOLARIS)
++            if ((posixID == 0) || (posixID[0] == '\0')) {
++                posixID = getenv(category == LC_MESSAGES ? "LC_MESSAGES" : "LC_CTYPE");
++                if ((posixID == 0) || (posixID[0] == '\0')) {
++#else
+             if (posixID == 0) {
+                 posixID = getenv(category == LC_MESSAGES ? "LC_MESSAGES" : "LC_CTYPE");
+                 if (posixID == 0) {
++#endif                    
+                     posixID = getenv("LANG");
+                 }
+             }
+@@ -1904,7 +1913,10 @@
+ 
+     localeName = uprv_getPOSIXIDForDefaultCodepage();
+     uprv_memset(codesetName, 0, sizeof(codesetName));
+-#if U_HAVE_NL_LANGINFO_CODESET
++    /* On Solaris nl_langinfo returns C locale values unless setlocale
++     * was called earlier.
++     */
++#if (U_HAVE_NL_LANGINFO_CODESET && !defined(U_SOLARIS))
+     /* When available, check nl_langinfo first because it usually gives more
+        useful names. It depends on LC_CTYPE.
+        nl_langinfo may use the same buffer as setlocale. */