* Locales with legacy codepages
@ 2014-09-16 3:23 Рысь
2014-09-16 16:43 ` Rich Felker
0 siblings, 1 reply; 3+ messages in thread
From: Рысь @ 2014-09-16 3:23 UTC (permalink / raw)
To: musl
Hello,
I am running a server which needs to speak with connected clients on a legacy codepage (in particular, cp1251, widely used by Russian people on Windows), and it has built-in gettext translation which can be activated only by setting a proper locale.
However I don't know how musl supports locales with legacy codepages, if even. I don't fully understand how such translations work, so if there any ways to make legacy codepage locales work?
On previous glibc system I started such server with LC_ALL=ru_RU.CP1251 environment variable and appropriate locale was defined with localedef.
I have an option to convert all outgoing locale messages with iconv if musl does not have such support.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Locales with legacy codepages
2014-09-16 3:23 Locales with legacy codepages Рысь
@ 2014-09-16 16:43 ` Rich Felker
2014-09-17 1:49 ` Рысь
0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2014-09-16 16:43 UTC (permalink / raw)
To: musl
On Tue, Sep 16, 2014 at 11:23:35AM +0800, Рысь wrote:
> Hello,
>
> I am running a server which needs to speak with connected clients on
> a legacy codepage (in particular, cp1251, widely used by Russian
> people on Windows), and it has built-in gettext translation which
> can be activated only by setting a proper locale.
> However I don't know how musl supports locales with legacy
> codepages, if even. I don't fully understand how such translations
> work, so if there any ways to make legacy codepage locales work?
>
> On previous glibc system I started such server with
> LC_ALL=ru_RU.CP1251 environment variable and appropriate locale was
> defined with localedef.
>
> I have an option to convert all outgoing locale messages with iconv
> if musl does not have such support.
Using iconv is the the way to do this with musl. The only encoding
supported as the native locale encoding is UTF-8 and there are no
plans to change this. Since musl's iconv is not optimized for
conversion _to_ legacy codesets, if you find this is a performance
bottleneck, you might do better just to skip iconv and use your own
conversion function that's specific to cp1251.
Rich
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Locales with legacy codepages
2014-09-16 16:43 ` Rich Felker
@ 2014-09-17 1:49 ` Рысь
0 siblings, 0 replies; 3+ messages in thread
From: Рысь @ 2014-09-17 1:49 UTC (permalink / raw)
To: musl
17 сентября 2014 г. 0:43:46 KRAT, Rich Felker <dalias@libc.org> пишет:
>On Tue, Sep 16, 2014 at 11:23:35AM +0800, Рысь wrote:
>> Hello,
>>
>> I am running a server which needs to speak with connected clients on
>> a legacy codepage (in particular, cp1251, widely used by Russian
>> people on Windows), and it has built-in gettext translation which
>> can be activated only by setting a proper locale.
>> However I don't know how musl supports locales with legacy
>> codepages, if even. I don't fully understand how such translations
>> work, so if there any ways to make legacy codepage locales work?
>>
>> On previous glibc system I started such server with
>> LC_ALL=ru_RU.CP1251 environment variable and appropriate locale was
>> defined with localedef.
>>
>> I have an option to convert all outgoing locale messages with iconv
>> if musl does not have such support.
>
>Using iconv is the the way to do this with musl. The only encoding
>supported as the native locale encoding is UTF-8 and there are no
>plans to change this. Since musl's iconv is not optimized for
>conversion _to_ legacy codesets, if you find this is a performance
>bottleneck, you might do better just to skip iconv and use your own
>conversion function that's specific to cp1251.
>
>Rich
Ok, I understand that my case is from those that should not happen in modern environments like systems based on musl libc. I will try iconv then.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-17 1:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-16 3:23 Locales with legacy codepages Рысь
2014-09-16 16:43 ` Rich Felker
2014-09-17 1:49 ` Рысь
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).