#534 POCO_HAVE_IPv6 without POCO_WIN32_UTF8 conflict

Documentation
closed
Net (141)
3
2012-11-10
2012-06-18
Alex Fabijanic
No

When you compile Poco::Net with POCO_HAVE_IPv6 but without POCO_WIN32_UTF8 you get an error due to the use of the
Poco::UnicodeConverter::toUTF16 and Poco::UnicodeConverter::toUTF8 in the function subnetMaskForInterface
The !defined(POCO_WIN32_UTF8) code is missing and is usually coded like in bool WinRegistryKey::exists() function
I think should be useful to add here the code even for no UTF8

I found another litle problem using IPv6 enabled and UTF8 disabled in the file NetworkInterface.cpp there's the function:
int rc = WideCharToMultiByte(CP_ACP, WC_DEFAULTCHAR, pAddress->FriendlyName, -1, displayNameBuffer, sizeof(displayNameBuffer), NULL, NULL);

I think that "WC_DEFAULTCHAR" it's wrong and should be replaced with "0" because otherwise the function return error and the network adapter name will be empty

Discussion

  • Alex Fabijanic
    Alex Fabijanic
    2012-08-18

    POCO_HAVE_IPv6 without POCO_WIN32_UTF8 does not apply to trunk TODO: look at it in 1.4.4 branch

    changed WC_DEFAULTCHAR to 0 in trunk code, rev. 1957

    http://poco.svn.sourceforge.net/poco/?rev=1957&view=rev

     
    • status: open --> closed
    • milestone: --> Documentation