Replace unicode characters in comments with ascii
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Mon, 1 Nov 2021 21:42:49 +0000 (22:42 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Mon, 1 Nov 2021 21:42:49 +0000 (22:42 +0100)
The unicode characters, while in comments and not code, caused MSVC
to emit compiler warning C4819:

  The file contains a character that cannot be represented in the
  current code page (number).  Save the file in Unicode format to
  prevent data loss.

Fix by replacing the characters in print.c with descriptive comments
containing the codepoints and symbol names, and remove the character
in brin_bloom.c which was a footnote reference copied from the paper
citation.

Per report from hamerkop in the buildfarm.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/340E4118-0D0C-4E85-8141-8C40EB22DA3A@yesql.se

src/backend/access/brin/brin_bloom.c
src/fe_utils/print.c

index 2c8a20aaca6488c6a767a51af4e8d2b0fe35309d..09b8d04a46a4ad16e627f1509337714d241e3468 100644 (file)
@@ -49,7 +49,7 @@
  * We use a scheme requiring only two functions described in this paper:
  *
  * Less Hashing, Same Performance:Building a Better Bloom Filter
- * Adam Kirsch, Michael Mitzenmacher, Harvard School of Engineering and
+ * Adam Kirsch, Michael Mitzenmacher, Harvard School of Engineering and
  * Applied Sciences, Cambridge, Massachusetts [DOI 10.1002/rsa.20208]
  *
  * The two hash functions h1 and h2 are calculated using hard-coded seeds,
index d48fcc4a0328de76bd6b13d6313805e54eca118f..cc245a9c4bf9a0eb7c001b39c2edd31ca96b5138 100644 (file)
@@ -140,56 +140,126 @@ typedef struct unicodeStyleFormat
 static const unicodeStyleFormat unicode_style = {
    {
        {
-           /*  */
+           /* U+2500 Box Drawings Light Horizontal */
            "\342\224\200",
-           /* ├╟ */
+
+           /*--
+            * U+251C Box Drawings Light Vertical and Right,
+            * U+255F Box Drawings Vertical Double and Right Single
+            *--
+            */
            {"\342\224\234", "\342\225\237"},
-           /* ┤╢ */
+
+           /*--
+            * U+2524 Box Drawings Light Vertical and Left,
+            * U+2562 Box Drawings Vertical Double and Left Single
+            *--
+            */
            {"\342\224\244", "\342\225\242"},
        },
        {
-           /*  */
+           /* U+2550 Box Drawings Double Horizontal */
            "\342\225\220",
-           /* ╞╠ */
+
+           /*--
+            * U+255E Box Drawings Vertical Single and Right Double,
+            * U+2560 Box Drawings Double Vertical and Right
+            *--
+            */
            {"\342\225\236", "\342\225\240"},
-           /* ╡╣ */
+
+           /*--
+            * U+2561 Box Drawings Vertical Single and Left Double,
+            * U+2563 Box Drawings Double Vertical and Left
+            *--
+            */
            {"\342\225\241", "\342\225\243"},
        },
    },
    {
        {
-           /*  */
+           /* U+2502 Box Drawings Light Vertical */
            "\342\224\202",
-           /* ┼╪ */
+
+           /*--
+            * U+253C Box Drawings Light Vertical and Horizontal,
+            * U+256A Box Drawings Vertical Single and Horizontal Double
+            *--
+            */
            {"\342\224\274", "\342\225\252"},
-           /* ┴╧ */
+
+           /*--
+            * U+2534 Box Drawings Light Up and Horizontal,
+            * U+2567 Box Drawings Up Single and Horizontal Double
+            *--
+            */
            {"\342\224\264", "\342\225\247"},
-           /* ┬╤ */
+
+           /*--
+            * U+252C Box Drawings Light Down and Horizontal,
+            * U+2564 Box Drawings Down Single and Horizontal Double
+            *--
+            */
            {"\342\224\254", "\342\225\244"},
        },
        {
-           /*  */
+           /* U+2551 Box Drawings Double Vertical */
            "\342\225\221",
-           /* ╫╬ */
+
+           /*--
+            * U+256B Box Drawings Vertical Double and Horizontal Single,
+            * U+256C Box Drawings Double Vertical and Horizontal
+            *--
+            */
            {"\342\225\253", "\342\225\254"},
-           /* ╨╩ */
+
+           /*--
+            * U+2568 Box Drawings Up Double and Horizontal Single,
+            * U+2569 Box Drawings Double Up and Horizontal
+            *--
+            */
            {"\342\225\250", "\342\225\251"},
-           /* ╥╦ */
+
+           /*--
+            * U+2565 Box Drawings Down Double and Horizontal Single,
+            * U+2566 Box Drawings Double Down and Horizontal
+            *--
+            */
            {"\342\225\245", "\342\225\246"},
        },
    },
    {
-       /* └│┌─┐┘ */
+       /*--
+        * U+2514 Box Drawings Light Up and Right,
+        * U+2502 Box Drawings Light Vertical,
+        * U+250C Box Drawings Light Down and Right,
+        * U+2500 Box Drawings Light Horizontal,
+        * U+2510 Box Drawings Light Down and Left,
+        * U+2518 Box Drawings Light Up and Left
+        *--
+        */
        {"\342\224\224", "\342\224\202", "\342\224\214", "\342\224\200", "\342\224\220", "\342\224\230"},
-       /* ╚║╔═╗╝ */
+
+       /*--
+        * U+255A Box Drawings Double Up and Right,
+        * U+2551 Box Drawings Double Vertical,
+        * U+2554 Box Drawings Double Down and Right,
+        * U+2550 Box Drawings Double Horizontal,
+        * U+2557 Box Drawings Double Down and Left,
+        * U+255D Box Drawings Double Up and Left
+        *--
+        */
        {"\342\225\232", "\342\225\221", "\342\225\224", "\342\225\220", "\342\225\227", "\342\225\235"},
    },
    " ",
-   "\342\206\265",             /* ↵ */
+   /* U+21B5 Downwards Arrow with Corner Leftwards */
+   "\342\206\265",
    " ",
-   "\342\206\265",             /* ↵ */
-   "\342\200\246",             /* … */
-   "\342\200\246",             /* … */
+   /* U+21B5 Downwards Arrow with Corner Leftwards */
+   "\342\206\265",
+   /* U+2026 Horizontal Ellipsis */
+   "\342\200\246",
+   "\342\200\246",
    true
 };