Boost logo

Boost Users :

Subject: Re: [Boost-users] [locale] Quick questions
From: Artyom Beilis (artyomtnk_at_[hidden])
Date: 2011-11-07 05:35:09


> From: Jookia <166291_at_[hidden]>
<
> Hey! I have some small questions about Boost.Locale.
>
> 1. Is it safe to assume that Boost.Locale API methods (like gettext) return
> UTF-8 strings, or are they locale dependent?
>

No encoding is locale dependent however UTF-8 is OS default on all
modern systems.

You can check it using boost::locale::info facet.

> 2. I use a custom domain, but when calling gettext("...") I still get
> lovely English text. However, calling gettext("...", std::locale())
> fixes that. Is there some way to set the default domain/locale for gettext so I
> can simply write gettext("...")?

Use std::locale::global(locale_you_need_to_install)

>
> 3. What's the deal with the whole locale/$LANG/LC_MESSAGES/$domain.mo folder
> structure? I know it has Unix heritage, but why is it explicity forced? It seems
> like a complex structure compared to locale/$LANG-$domain.mo.

This is standard gettext directory structure. It is used by windows gettext users
as well

Using LC_MESSAGES would allow to extend the catalogs with some more data.

Artyom


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net