Fix printing of directory name on gn clean failure

The 'gn clean' code that detects whether something is a build directory
was, on Windows, printing a wchar_t* string using %s with a char*
format string. This means that only the drive letter gets printed.
Fixed by using FilePathToUTF8().

Running /analyze on gn confirmed that this is the only bug of its type
and found a few other more minor glitches, filed as part of the
referenced bug.

BUG=643842

Review-Url: https://codereview.chromium.org/2308113002
Cr-Original-Commit-Position: refs/heads/master@{#416651}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e17ac37d6c181f2d4ec5ac51eda4717af3505596
diff --git a/tools/gn/command_clean.cc b/tools/gn/command_clean.cc
index d14b22d..f0348d9 100644
--- a/tools/gn/command_clean.cc
+++ b/tools/gn/command_clean.cc
@@ -8,6 +8,7 @@
 #include "base/strings/stringprintf.h"
 #include "tools/gn/commands.h"
 #include "tools/gn/err.h"
+#include "tools/gn/filesystem_utils.h"
 #include "tools/gn/setup.h"
 
 namespace {
@@ -84,8 +85,9 @@
   base::FilePath build_ninja_d_file = build_dir.AppendASCII("build.ninja.d");
   if (!base::PathExists(build_ninja_d_file)) {
     Err(Location(),
-        base::StringPrintf("%s does not look like a build directory.\n",
-                           build_ninja_d_file.DirName().value().c_str()))
+        base::StringPrintf(
+            "%s does not look like a build directory.\n",
+            FilePathToUTF8(build_ninja_d_file.DirName().value()).c_str()))
         .PrintToStdout();
     return 1;
   }