Boost logo

Boost :

Subject: Re: [boost] [review] Review of Nowide (Unicode)
From: Artyom Beilis (artyom.beilis_at_[hidden])
Date: 2017-06-23 20:39:16


On Fri, Jun 23, 2017 at 5:35 PM, Groke, Paul via Boost
<boost_at_[hidden]> wrote:
>
> I think it's convenient to have the function that does the conversion in the Nowide library itself, even if it just calls come other function. That way the user doesn't have to know or care what kind of exact conversion rules Nowide uses - they can just call nowide::widen/narrow.
>

I see

>> Regarding iterator input/output interface.
>>
> [snip]
>
> I'm not suggesting an iterator-based interface. I'm just suggesting two changes. 1: change
>
> stack_wstring wstr;
> wstr.convert(input);
>
> to
>
> stack_wstring wstr;
> widen(wstr, input);
>
> I.e. move the conversion function out of the string class. And then 2: allow arbitrary (string) types instead of stack_wstring. Not via iterators, the widen/narrow functions could (should) simply use push_back(char) or append(char const*, char const*) to "build" the output string.
>

Now I understand what do you mean. I assume it can be done/

>> Shouldn't be a problem. Finally all goes to console.
>
> Won't buffering cause trouble - especially for input?
>

It should be similar to behavior of std::cin as it uses tie call so
apparently on the output side shoudn't be problem. (Also good point to
test)
Regarding input it of course will be much trickier. More testing would
likely be needed and I see more potential problems.

I'll need to check it as well and if limitation exist report them

Artyom


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