Fixed file encoding and added C++ specific buffer settings.