Language-specific case-conversion doesn't honor locale
authorMichael Gran <spk121@yahoo.com>
Thu, 24 Sep 2009 15:07:38 +0000 (08:07 -0700)
committerMichael Gran <spk121@yahoo.com>
Thu, 24 Sep 2009 15:15:31 +0000 (08:15 -0700)
commitaafb5062b834dc468fa2acdec7eda12e389c5bca
tree083302744de13d94527c2becbefc96d2210037c9
parentbcccf04158bda5319776d45abd6cc748b794096b
Language-specific case-conversion doesn't honor locale

Libunistring uses a function uc_locale_language to extract the
current language from the locale information.  It does this by calling
setlocale.  This makes incompatible with Guile functions that use the
locale_t thread-specific locale API, because the values returned by the
call to setlocale ignore the locale set by uselocale.

As a workaround, this patch extracts the language from the locale_t
structure's __names field.

A more complete solution is needed.  Perhaps that solution would test
that the __names field exists in the configure step and revert to
!USE_GNU_LOCALE_API in that case.

* libguile/i18n.c (locale_language): new function that performs the
  same job as uc_locale_language but is compatible with uselocale
  (u32_locale_casecoll, u32_locale_tocase): replace uc_locale_language
  with locale_language
libguile/i18n.c