Discussion:
[boost] [nowide] review
Andrzej Krzemienski via Boost
2017-06-19 21:28:36 UTC
Permalink
Hi All.
This is a review of Boost.Nowide library.

I am not really familiar with the problem. I used to do trivial tasks with
files on Windows, but they were always ASCII, so the problems solved by
Boost.Nowide never affected me. I am also not fa,iliar with the problems of
converting from Windows encoding (*WTF* seems like the right choice of
name) to UTF-8.

I have read the documentation, and got some additional information from the
author. I have downloaded the library and have run a toy program that plays
with names that cannot be encoded in a single code-page. I am testing on
Windows 7, MinGW, GCC 6.3, with -std=c++03. Compilation and linking works
fine. Tests work fine too. Then, I tried the same example with normal
`std::ifstream` and it did not work on Unicode file names and strings,
which conforms that Boost.Nowide solves an existing problem.

DESIGN: clear, logical, intuitive.
IMPLEMENTATION: I did not look at.
DOCUMENTATION: clear.
POTENTIAL USEFULNESS: as specified in the docs, if you want to do things
with multilingual strings in a platform independent way, you need a library
like this.

I vote to *ACCEPT* the library. I may not be qualified enough (the manager
will weigh my vote), but the desctiption of the library, as well as the
replies from Artyom convince me that the library addresses the problem in
the right way and is reliable.

Artyom, thanks for sharing this library, and submitting it for review.

One minor thing. In th be docs (http://cppcms.com/files/nowide/html/) we
read:
boost::nowide::widen
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6baacc1bb80c134a2ce37f13977b5500>
returns std::string.

I thing is thsould be std::wstring?

Regards,
&rzej;

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Artyom Beilis via Boost
2017-06-20 07:47:45 UTC
Permalink
On Tue, Jun 20, 2017 at 12:28 AM, Andrzej Krzemienski via Boost
Post by Andrzej Krzemienski via Boost
Hi All.
This is a review of Boost.Nowide library.
[snip[
DESIGN: clear, logical, intuitive.
IMPLEMENTATION: I did not look at.
DOCUMENTATION: clear.
POTENTIAL USEFULNESS: as specified in the docs, if you want to do things
with multilingual strings in a platform independent way, you need a library
like this.
I vote to *ACCEPT* the library. I may not be qualified enough (the manager
will weigh my vote), but the desctiption of the library, as well as the
replies from Artyom convince me that the library addresses the problem in
the right way and is reliable.
Artyom, thanks for sharing this library, and submitting it for review.
Thank You very much for the review and the inputs.
Post by Andrzej Krzemienski via Boost
One minor thing. In th be docs (http://cppcms.com/files/nowide/html/) we
boost::nowide::widen
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6baacc1bb80c134a2ce37f13977b5500>
returns std::string.
I thing is thsould be std::wstring?
Regards,
&rzej;
Actually this version is for fixed user buffer - function without
allocation. So it is right one. Another versions return std::wstring

Regards

Artyom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Andrzej Krzemienski via Boost
2017-06-20 08:37:08 UTC
Permalink
Post by Artyom Beilis via Boost
On Tue, Jun 20, 2017 at 12:28 AM, Andrzej Krzemienski via Boost
Post by Andrzej Krzemienski via Boost
Hi All.
This is a review of Boost.Nowide library.
[snip[
DESIGN: clear, logical, intuitive.
IMPLEMENTATION: I did not look at.
DOCUMENTATION: clear.
POTENTIAL USEFULNESS: as specified in the docs, if you want to do things
with multilingual strings in a platform independent way, you need a
library
Post by Andrzej Krzemienski via Boost
like this.
I vote to *ACCEPT* the library. I may not be qualified enough (the
manager
Post by Andrzej Krzemienski via Boost
will weigh my vote), but the desctiption of the library, as well as the
replies from Artyom convince me that the library addresses the problem in
the right way and is reliable.
Artyom, thanks for sharing this library, and submitting it for review.
Thank You very much for the review and the inputs.
Post by Andrzej Krzemienski via Boost
One minor thing. In th be docs (http://cppcms.com/files/nowide/html/) we
boost::nowide::widen
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#
a6baacc1bb80c134a2ce37f13977b5500>
Post by Andrzej Krzemienski via Boost
returns std::string.
I thing is thsould be std::wstring?
Regards,
&rzej;
Actually this version is for fixed user buffer - function without
allocation. So it is right one. Another versions return std::wstring
But when I look into the reference page:
http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6baacc1bb80c134a2ce37f13977b5500

I cannot see any overload returning `std::string`?

Regards,
&rzej;

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Artyom Beilis via Boost
2017-06-20 09:02:39 UTC
Permalink
Post by Andrzej Krzemienski via Boost
Post by Artyom Beilis via Boost
Thank You very much for the review and the inputs.
Post by Andrzej Krzemienski via Boost
One minor thing. In th be docs (http://cppcms.com/files/nowide/html/) we
boost::nowide::widen
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#
a6baacc1bb80c134a2ce37f13977b5500>
Post by Andrzej Krzemienski via Boost
returns std::string.
I thing is thsould be std::wstring?
Regards,
&rzej;
Actually this version is for fixed user buffer - function without
allocation. So it is right one. Another versions return std::wstring
http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6baacc1bb80c134a2ce37f13977b5500
I cannot see any overload returning `std::string`?
Regards,
&rzej;
These:

std::string narrow (wchar_t const *s)
std::wstring widen (char const *s)
std::string narrow (std::wstring const &s)
std::wstring widen (std::string const &s)

See: http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a13b4f6f7f97f889ec858dde2d367b130

Artyom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Andrzej Krzemienski via Boost
2017-06-20 09:20:10 UTC
Permalink
Post by Andrzej Krzemienski via Boost
Post by Andrzej Krzemienski via Boost
Post by Artyom Beilis via Boost
Thank You very much for the review and the inputs.
Post by Andrzej Krzemienski via Boost
One minor thing. In th be docs (http://cppcms.com/files/nowide/html/)
we
Post by Andrzej Krzemienski via Boost
Post by Artyom Beilis via Boost
Post by Andrzej Krzemienski via Boost
boost::nowide::widen
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#
a6baacc1bb80c134a2ce37f13977b5500>
Post by Andrzej Krzemienski via Boost
returns std::string.
I thing is thsould be std::wstring?
Regards,
&rzej;
Actually this version is for fixed user buffer - function without
allocation. So it is right one. Another versions return std::wstring
http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#
a6baacc1bb80c134a2ce37f13977b5500
Post by Andrzej Krzemienski via Boost
I cannot see any overload returning `std::string`?
Regards,
&rzej;
std::string narrow (wchar_t const *s)
std::wstring widen (char const *s)
std::string narrow (std::wstring const &s)
std::wstring widen (std::string const &s)
See: http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#
a13b4f6f7f97f889ec858dde2d367b130
Yes, I can see those. And what they say is that functions called `narrow`
return a `std::string`, and functions `widen` return a `std::wstring`, and
this makes perfect sense for me.

But the quoted tutorial says:

boost::nowide::widen
Post by Andrzej Krzemienski via Boost
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6baacc1bb80c134a2ce37f13977b5500>
returns std::string.
It says something different than the declarations you have quoted.

Regards,
&rzej;

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Artyom Beilis via Boost
2017-06-20 09:22:41 UTC
Permalink
.
Post by Andrzej Krzemienski via Boost
boost::nowide::widen
Post by Andrzej Krzemienski via Boost
<http://cppcms.com/files/nowide/html/namespaceboost_1_1nowide.html#a6baacc1bb80c134a2ce37f13977b5500>
returns std::string.
It says something different than the declarations you have quoted.
Regards,
&rzej;
Ahhhhhhh

Now I got it. You refer to
http://cppcms.com/files/nowide/html/index.html#using_custom

Yes you are right - I need to fix it.

Artyom

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