Boost logo

Boost :

Subject: Re: [boost] [review] Review of Nowide (Unicode) starts today
From: Peter Dimov (lists_at_[hidden])
Date: 2017-06-12 15:03:27


Artyom Beilis wrote:

> > Question: what do the functions do (on Windows) when the passed UTF-8 is
> > invalid? From a brief look at the documentation, I don't see this
> > specified, but I may have missed it.
>
>
> It is documented in reference documentation.
>
> http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6644397c539754076b11e95c535be192

Yes, I see now that it's documented on some, such as for instance fopen:

    If invalid UTF-8 given, NULL is returned and errno is set to EINVAL

but not all, for instance getenv:

    UTF-8 aware getenv. Returns 0 if the variable is not set.

or setenv:

    UTF-8 aware setenv, key - the variable name, value is a new UTF-8
value,.

and it's not clear what happens when one feeds invalid UTF-8 to cout/cerr.

Another minor point is that the library assumes Cygwin is POSIX and tries
`using ::setenv;`, which is a compile error. For the purposes of Nowide,
Cygwin should be considered Windows.


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