pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.43k stars 2.17k forks source link

Environment.cpp does not use Environment_WIN32U.cpp when POCO_WIN32_UTF8 is defined #2550

Closed dry013 closed 2 years ago

dry013 commented 5 years ago

I would expect a check for POCO_WIN32_UTF8 at the top of Environment.cpp to include the correct Impl, but only Environment_WIN32.cpp is included for regular Windows.

Compare this to the top of DirectoryIterator.cpp which checks POCO_WIN32_UTF8 and includes DirectoryIterator_WIN32U.cpp or DirectoryIterator_WIN32.cpp accordingly.

Poco version 1.9.0, also looked at develop branch and no change there

Full code search shows nothing ever including Environment_WIN32U.cpp

dry013 commented 5 years ago

I believe the top define checks in Environment.cpp should be changed to the following: (the two changed lines are in bold)

if defined(POCO_VXWORKS)

include "Environment_VX.cpp"

elif defined(POCO_OS_FAMILY_UNIX)

include "Environment_UNIX.cpp"

elif defined(POCO_OS_FAMILY_WINDOWS)

if defined(_WIN32_WCE)

include "Environment_WINCE.cpp"

**#elif defined(POCO_WIN32_UTF8)

include "Environment_WIN32U.cpp"**

else

include "Environment_WIN32.cpp"

endif

endif

edit: indicated the wrong file originally

Bjoe commented 5 years ago

May I ask, how you are define POCO_WIN32_UTF8? Which build system you are using? For or on which platform you are compiling POCO?

dry013 commented 5 years ago

POCO_WIN32_UTF8 is defined in Platform_WIN32.h and building on Windows without it has been generally depreciated since 1.6.0 (see release notes). I'm compiling POCO on Windows using mingw-w64 / GCC (yes I know it's currently unsupported but Visual Studio will have the same issue).

Environment_WIN32U.cpp is the platform specific code to support Windows Unicode in the Environment package. Environment.cpp should include it but never does.

Note: I edited my previous comment. Originally I had indicated the wrong file (sorry).

zosrothko commented 5 years ago

@dry013 MinGw is supported as an experimental port. Please contact @ark0f for the details.

ark0f commented 5 years ago

MinGW has been supporting since the end of July (still in develop branch), when Environment_WIN32U.cpp file had already deleted. As I understand, problem concerns only 1.9.0 version, don't I?

dry013 commented 5 years ago

Before logging the issue I did look ahead into the 1.9.1 branch and the bug was still present. I checked again now this is still true. If a 1.9.1 release is still planned, it would helpful to get the bug fixed in that branch.

Looking further ahead into develop, the original ANSI Environment_WIN32.cpp was removed and Environment_WIN32U.cpp was renamed to replace it. This removal of all the ANSI Windows calls does fix the issue in the develop branch.

The issue only exists in the 1.9.0 and 1.9.1 branches.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 365 days with no activity.