Therefore - 2016-06-28

Windows 10
MS VS 2015
C++11
Boost 1.60

I create this symbolic link:

mklink /J "C:\T4 2.0\ApplicationSymlinks\T4"  "C:\T4 2.0\Data"

This is a much simplified version of a program to check if the symbolic link is linked to the proper directory:

#include <boost/filesystem.hpp>
#include <iostream>
int main()
{
    boost::filesystem::path directory = "c:\\T4 2.0\\Data";

    boost::filesystem::path symlink = "c:\\T4 2.0\\ApplicationSymlinks\\T4";
    boost::filesystem::path path_linked_to("");
    path_linked_to = boost::filesystem::read_symlink(symlink);    // Resolve symlink. path_linked_to is not absolute. L"\\T4 2.0\\Data"
    path_linked_to = boost::filesystem::absolute(path_linked_to); // Absolute path. L"c:\\T4 2.0\\Data"

    if (directory == path_linked_to)
        std::cout << "paths are equal" << std::endl;
    else
        std::cout << "paths are not equal" << std::endl;                    
    return 0;
}

The output is "paths are not equal". Shouldn't they be equal? In the autos window of the debugger I do see this:

directory size 14 capacity 15`

where as

path_linked_to size 16 capacity 23` because it includes two trailing '\0's.

These two trailing '\0's are introduced in read_symlink.

How do I resolve this? Why doesn't read_symlink return an absolute? Why does read_symlink add in two trailing '\0's (assuming that is the problem)? Why does operator== not ignore the '\0's?