bugGNU libunistring - Bugs: bug #27520, uc_locale_language incompatible...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27520: uc_locale_language incompatible with the locale_t uselocale API

Submitted by:  Mike Gran <mike121>
Submitted on:  Thu 24 Sep 2009 09:52:00 PM UTC  
 
Category: InterfaceSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Wed 23 Dec 2009 02:56:48 PM UTC, comment #1:

Thanks for the report. It is fixed in gnulib as of 2009-12-23.
I chose your proposed fix #1: make uc_locale_language aware
of the thread locale.

The fix will be reflected in subsequent libunistring builds.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Thu 24 Sep 2009 09:52:00 PM UTC, original submission:

Hi-

In a case where we are using the POSIX 2008 thread-specific locale functions like uselocale instead of setlocale, uc_locale_language returns the language returned by setlocale other than the thread-specific one in uselocale.

We call uc_locale_language to prepare inputs to u32_locale_tolower, etc, which Guile will likely use in it i18n library for its upcoming 2.0 release. That i18n library will also use uselocale if it is available: hence the problem.

We have a fragile workaround in place that works for GNU libc, but, it very likely incompatible with other C libraries because it relies on knowledge of the semi-opaque locale_t that GNU libc defines in <xlocale.h>. I've attached that as locale_language.c

There are quite a few ways to work around this problem on our end, but, it would be neat if libunistring/gnulib could provide the capability to

1. have a version of uc_locale_language compatible with uselocale
2. or, have a version of uc_locale_language that takes a locale_t
3. or, have a version of u32_locale_to{lower,upper} that takes a locale_t
4. or, something even more awesome

I'm happy to help in any way.

Thanks,

Mike Gran

Mike Gran <mike121>

 

Attached Files
file #18769:  locale_language.c added by mike121 (1KiB - text/x-csrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  • -unavailable- added by mike121 (Submitted the item)
  • -unavailable- added by mike121
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 24 Nov 2016 12:26:52 AM UTChaibleCategoryNone=>Interface
    Wed 23 Dec 2009 02:56:48 PM UTChaibleStatusNone=>Fixed
      Assigned toNone=>haible
      Open/ClosedOpen=>Closed
    Thu 24 Sep 2009 09:52:00 PM UTCmike121Attached File-=>Added locale_language.c, #18769
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1