Fix file encoding.

The issue was spotted by iceiceice.
Remove a template specifier.

Instanciating std::make_pair normally shouldn't be used with template
specifiers. In this case it broke compilation for C++11.
Select the proper overload for boost::bind.

In C++11 there are two viable overload of the function. Specify the
proper overload to avoid a compilation error.
Fix compilation with C++11.
Allow old-style casts for a file.

It uses some external macros that add the old style casts.
Disable a useless cast in CMakeLists.txt.

The uselessness of the cast depends on the platform, so silence the
warning.