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

Submitter:  Mike Gran <mike121>
Submitted:  Thu 24 Sep 2009 09:52:00 PM UTC
   
 
Category:  Interface Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  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>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by mike121 (Submitted the item)
  • -email is unavailable- added by mike121
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-24 haible CategoryNone Interface
    2009-12-23 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2009-09-24 mike121 Attached File- Added locale_language.c, #18769
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code