diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index d5e77ae632f3b..d6f4e2e98367d 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -1766,6 +1766,8 @@ bool CommandLineInterface::MakeInputsBeProtoPathRelative( bool CommandLineInterface::ExpandArgumentFile( const char* file, std::vector* arguments) { +// On windows to force ifstream to handle proper utr-8, we need to convert to proper supported utf8 wstring. +// If we dont then the file can't be opened. #ifdef _MSC_VER // Convert the file name to wide chars. int size = MultiByteToWideChar(CP_UTF8, 0, file, strlen(file), NULL, 0);