Boost logo

Boost :

Subject: Re: [boost] Boost.Locale 'Status'?
From: Artyom Beilis (artyomtnk_at_[hidden])
Date: 2011-07-26 16:42:34


Thanks...

This is seems to be really strange...

looks like iconv does not support too much encodings...

Would you be so kind and give me the output of
this program?

#include <iconv.h>
#include <iostream>

void check_one(char const *to,char const *from)
{
        iconv_t d=iconv_open(to,from);
        if(d!=(iconv_t)(-1)) {
                iconv_close(d);
                std::cout << from <<"->" << to << " ok" << std::endl;
        }
        else {
                std::cout << from <<"->" << to << " fail" << std::endl;
        }
}

void check(char const *n)
{
        check_one("us-ascii",n);
        check_one("utf-8",n);
        check_one(n,n);
}

int main()
{
        check("UTF-8");
        check("UTF-16");
        check("UTF-32");
        check("WCHAR_T");
        check("UTF-16LE");
        check("UTF-16BE");
        check("UTF-32LE");
        check("UTF-32BE");
        check("ISO-8859-1");
        check("ISO-8859-8");
        check("windows-1255");
        check("Shift-JIS");
}

You need to link it with iconv "-liconv"

Thanks!

Artyom

--- On Tue, 7/26/11, Lars Viklund <zao_at_[hidden]> wrote:

> From: Lars Viklund <zao_at_[hidden]>
>
> [snip]
> The commit seems to fix the compilation of libboost_locale,
> but the
> results of the tests seem somewhat depressing. A test log
> follows after
> this list of available locales as per 'locale -a':
> [snip]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk