Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-05-29 01:10:18


Hi Misha,

Misha Bergal wrote:

> "Vladimir Prus" <ghost_at_[hidden]> wrote in message
> news:bb1e87$gc7$2_at_main.gmane.org...
>> I think it's better to wait for Unicode users to formulate what's needed.
> It
>> seems, for example, that the last approach would work better for me on
>> Linux.
> Visual C++
> int
> wmain( int argc, wchar_t* argv )
> {
> std::wcout << L"Hello, world!"<< std::endl;
> std::wcout << ( boost::wformat( L"Hello, %s" ) % L"world" ).str() <<
> std::endl;
> ...
> }
>
> That's what I have, I am not sure I want the differrnt usage for
> boost::program_options

I understand, you want to use:

     ... parse_command_line(argc, argv, ... )

The important point is that you don't necessary need two
versions/specialization of program_options to do that. QT can handle both
Unicode and 8-bit string, because QString is unicode.

On Linix, you don't have 'wmain', so you'll have to write

int main(int argc, char** argv)
{
        vector<wstring> wargs;
        for(...)
                wargs.push_back(local8bit_to_wstring(argv[i]);
}

Now, if you have portable implementation of 'local8bit_to_wstring',
program_options can be implemented using wstring. The interface functions
would merely convert char* to wstring if needed and wchar_t* will be
supported without any effort.

- Volodya

>
> Misha
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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