
Hello all Booster, Boost.Nowide updates: The library provides an implementation of standard C and C++ library functions such that their inputs are UTF-8 aware on Windows without requiring using Wide API to make program work on Windows. --------------------------------- I had updated the library: - Changed boost::nowide::convert to boost::nowide::widen, boost::nowide::narrow - Changed boost::nowide::args to restore an original values in destructor - Updated the docs. Also I had created a stand-alone version of the nowide library such that it does not require boost and can be build with CMake - the use is the same just change: #include <boost/nowide/foo.hpp> ... boost::nowide::fstream To #include <nowide/foo.hpp> ... nowide::fstream ------------ Looking forward for more comments on a library that I want to submit for a formal review. Library: Boost.Nowide Download: http://cppcms.com/files/nowide/nowide.zip Documents: http://cppcms.com/files/nowide/html/ Non-Boost: http://cppcms.com/files/nowide/nowide_standalone.zip Git Repo: git://cppcms.git.sourceforge.net/gitroot/cppcms/nowide Tested On: OS: Windows 7 32/64 bit, Linux Compilers: GCC-4.6, MSVC-10 Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/

On Sun, Jun 3, 2012 at 1:16 AM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
Hello all Booster,
Boost.Nowide updates:
The library provides an implementation of standard C and C++ library functions such that their inputs are UTF-8 aware on Windows without requiring using Wide API to make program work on Windows.
---------------------------------
I had updated the library:
- Changed boost::nowide::convert to boost::nowide::widen, boost::nowide::narrow - Changed boost::nowide::args to restore an original values in destructor - Updated the docs.
Also I had created a stand-alone version of the nowide library such that it does not require boost and can be build with CMake - the use is the same just change:
#include <boost/nowide/foo.hpp> ... boost::nowide::fstream
To
#include <nowide/foo.hpp> ... nowide::fstream
------------
Looking forward for more comments on a library that I want to submit for a formal review.
Library: Boost.Nowide Download: http://cppcms.com/files/nowide/nowide.zip Documents: http://cppcms.com/files/nowide/html/ Non-Boost: http://cppcms.com/files/nowide/nowide_standalone.zip Git Repo: git://cppcms.git.sourceforge.net/gitroot/cppcms/nowide
Tested On:
OS: Windows 7 32/64 bit, Linux Compilers: GCC-4.6, MSVC-10
Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Hi, First off, I'd like to say that I'm excited to see this become a part of Boost. As for feedback, I have one suggestion and one nitpick. Suggestion: It would be nice if you could check the existing BOOST_USE_WINDOWS_H as well as BOOST_NOWIDE_USE_WINDOWS_H. Nitpick: cenv.hpp:48 The check on GetLastError is pointless. A return value of zero is indicative of failure, regardless of the specific reason, so there's no point doing further processing (As it currently stands, in the case that GetEnvironmentVariable fails with a different error code you will still call value.convert.). Thanks . Good luck with your future review.

----- Original Message -----
From: Joshua Boyce <raptorfactor@raptorfactor.com> On Sun, Jun 3, 2012 at 1:16 AM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
Looking forward for more comments on a library that I want to submit for a
Hi,
First off, I'd like to say that I'm excited to see this become a part of Boost.
As for feedback, I have one suggestion and one nitpick.
Suggestion: It would be nice if you could check the existing BOOST_USE_WINDOWS_H as well as BOOST_NOWIDE_USE_WINDOWS_H.
Good point, I was not aware of BOOST_USE_WINDOWS_H
Nitpick: cenv.hpp:48 The check on GetLastError is pointless. A return value of zero is indicative of failure, regardless of the specific reason,
It may return 0 if the environment string is an empty string.
so there's no point doing further processing (As it currently stands, in the case that GetEnvironmentVariable fails with a different error code you will still call value.convert.).
Also you are right, it is good idea to check if it returns some other error
Thanks . Good luck with your future review.
Thanks for inputs, Artyom

On Thu, Jun 7, 2012 at 12:05 AM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
It may return 0 if the environment string is an empty string.
Ah interesting, I misread the docs on first glance. I thought that it said "including the terminating character", I didn't see the "not". Thanks for responding.

On Thu, Jun 7, 2012 at 12:05 AM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
Also you are right, it is good idea to check if it returns some other error
Thanks . Good luck with your future review.
Thanks for inputs,
Artyom
Oh, while on the topic of error-checking, I have one more request... Could you please wrap your calls to LocalFree/FreeEnvironmentStrings with an assert of some sort? I know there's nothing you can do if the API fails for whatever obscure reason, and the chance of it failing under 'normal' circumstances is basically nonexistant, however I find it useful to have the asserts as in some cases they have caught legitimate bugs in both my code and the code of others (double-free, invalid handle, etc). At the very least it would give me just that little bit of extra 'peace of mind', and would have no effect on the speed of release builds. Thanks again.

Proposal: Add a sentry class that overrides std::cout/cerr/cin to work as boost::nowide::*. I understand that it cannot be done by default since it may 'break' code that writes to std::* and assumes some other encoding. However, when writing application code it's a reasonable assumption that 3rd party libraries will not write non-ASCII text to the global streams. -- Yakov

----- Original Message -----
From: Yakov Galka <ybungalobill@gmail.com> To: boost@lists.boost.org Cc: Sent: Wednesday, June 27, 2012 11:33 AM Subject: Re: [boost] [nowide] Updates and Standalone Version
Proposal: Add a sentry class that overrides std::cout/cerr/cin to work as boost::nowide::*.
Good idea, it also would allow to override std::c(in|out|err|log) globally in main() function.
I understand that it cannot be done by default since it may 'break' code that writes to std::* and assumes some other encoding. However, when writing application code it's a reasonable assumption that 3rd party libraries will not write non-ASCII text to the global streams.
The biggest problem is that if the original std::streambuf is not restored prior to destruction of std::c(out|in|err|log) than the application tends to crash :-)
-- Yakov
Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/

On Wed, Jun 27, 2012 at 1:36 PM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
The biggest problem is that if the original std::streambuf is not restored prior to destruction of std::c(out|in|err|log) than the application tends to crash :-)
How can it happen given the way I proposed it to do and assuming a standard conforming implementation? -- Yakov
participants (3)
-
Artyom Beilis
-
Joshua Boyce
-
Yakov Galka