setlocale behavior

Alexander Varnin fenixk19 at mail.ru
Thu Mar 7 18:25:46 UTC 2013


07.03.2013 22:24, Alexander Varnin пишет:
> 04.03.2013 12:53, Alexander Varnin пишет:
>> 01.03.2013 15:37, Alexander Varnin ?????:
>>> 28.02.2013 18:53, Filippo ARCIDIACONO ?????:
>>>> On 2/28/2013 1:06 PM, Alexander Varnin wrote:
>>>>> Hello.
>>>>> I'm using uClibc 0.9.33.2 with buildroot.
>>>>> My OS built with buildroot, and locale settings is to enable 
>>>>> ru_RU.UTF8 locale both in buildroot .config and uClibc .config.
>>>>> I'm trying to do
>>>>> setlocale(LC_CTYPE, "ru_RU.UTF-8")
>>>>> but return value of this function is "ru_RU.ISO-8859-1". As i 
>>>>> think, this can be reason for later error of wcsrtombs call, that 
>>>>> tries to convert russian wide characters to char.
>>>>> I don't know, if it is a bug, or wrong configuration, please help 
>>>>> me find out.
>>>>>
>>>>> Attaching test program and uClibc configuration.
>>>>>
>>>>> For me, test programs writes out:
>>>>> # ./wtest
>>>>> setlocale returns ru_RU.ISO-8859-1
>>>>> setlocale returns ru_RU.ISO-8859-1
>>>>> Wrong format
>>>>
>>>> Looking your config file seems UCLIBC_BUILD_MINIMAL_LOCALES is 
>>>> wrongly set, the string contains a blank character before 
>>>> ru_RU.UTF-8 locale.
>>>> Remove the blank character and try again.
>>>> Hoping this fix your problem.
>>>> Executing your test in my box it works fine.
>>>>
>>>> #./wtest
>>>> setlocale returns ru_RU.UTF-8
>>>> setlocale returns ru_RU.UTF-8
>>>> Everything ok.
>>>>
>>>> Regards,
>>>> Filippo.
>>>
>>> Thanks for help.
>>> Removing blank didn't help. Is it possible, that buildroot somehow 
>>> jams my locale settings?
>>> I'll attach buildroot configuration.
>>>
>>>
>>> _______________________________________________
>>> uClibc mailing list
>>> uClibc at uclibc.orgyone
>>> http://lists.busybox.net/mailman/listinfo/uclibc
>>
>> Anyone? If somebody can help, please i need it.
>> _______________________________________________
>> uClibc mailing list
>> uClibc at uclibc.org
>> http://lists.busybox.net/mailman/listinfo/uclibc
>
> My generated locales.txt table look strange. String ru_RU.UTF-8 
> ISO-8859-1 may be related to why i get wrong test result. Can anyone 
> tell me please, if it is so, and what can i do to fix it?
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
Here is locales.txt

-------------- next part --------------
@euro e
#-
UTF-8 yes
8-BIT yes
#-
ru_RU.UTF-8.UTF-8 UTF-8
ru_RU.UTF-8 ISO-8859-1


More information about the uClibc mailing list