luceneplusplus/LucenePlusPlus — pull request #50 by vslavik (2014-01-26 18:37:14+00:00)
Title: Fix incorrect paths handling on Windows.

Lucene++ keeps paths around as wide strings, but uses narrow char APIs (e.g.
std::ifstream) when accessing files, using conversion to UTF-8 to get char*
strings. This is correct on OS X and usually(!) correct on modern Unix systems,
but is completely wrong on Windows, which _never_ uses UTF-8 for filenames.

Fix this using boost::filesystem classes (path and streams) and appropriate
conversions. In one place, use a Windows-specific workaround to deal with lack
of wide char boost API.

In particular:

- Use boost::filesystem::*fstream classes that accept Unicode paths.
- Use boost::filesystem::(w)path for manual conversion when needed.
- When using char* only API (interprocess::file_lock), use GetShortPathName()
as a workaround.

Practical consequences of this incorrect handling were severe: it was impossible to store Lucene index in a directory with non-ASCII characters in it (such as the user's home directory!).