]> granicus.if.org Git - graphviz/commitdiff
convert fc-fix.cpp from UTF-16 to UTF-8
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 1 Apr 2022 00:35:15 +0000 (17:35 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Apr 2022 22:52:07 +0000 (15:52 -0700)
Of all the source files in the Graphviz tree, this file alone was encoded in
UTF-16 with a BOM.¹ BOMs have mostly fallen out of favor these days, with people
preferring to let the host operating system or locale determine encoding. Git
will happily translate text files to your local encoding on checkout. With that
in mind, we can convert this file to UTF-8 and stop forcing developers on other
operating systems to pay the price for Windows’ poor past decisions.

¹ https://en.wikipedia.org/wiki/Byte_order_mark

ci/clang_format.py
windows/cmd/fc-fix/fc-fix.cpp

index a42aa1e0ff5a01910e4661e3e5b98eec9cd353b8..a1c03656ec462ab45eea7ba19610d680677185c0 100644 (file)
@@ -913,11 +913,6 @@ for source in sources.split("\x00")[:-1]:
 
   print(f"checking {source}...")
 
-  # FIXME: this file contains invalid UTF-8 characters
-  if source == "windows/cmd/fc-fix/fc-fix.cpp":
-    print(f"skipping {source} due to malformed content")
-    continue
-
   with open(source, "rt", encoding="utf-8") as f:
     original = f.read()
 
index 9c9b0174737f3f242ff749a647ab0751c52b1a80..ec9b28424ebd844be8106934ae8539113ccb8330 100644 (file)
Binary files a/windows/cmd/fc-fix/fc-fix.cpp and b/windows/cmd/fc-fix/fc-fix.cpp differ