Spurious chars in terminal output from MSVC `std::print`.

OPEN

I wonder if anyone can reproduce this strange problem, which happens with MSVC std::print output to Windows Terminal.

It does not happen with MinGW g++.

It does not happen when std::print is replaced with printf.

#include <print>
#include <string_view>

namespace app {
    using   std::print,             // <print>
            std::string_view;       // <string_view>

    const string_view lines[] =
    {
        "                                                              ▄██▄",
        "                                                            ▄██▄▄██▄",
        "                                                          ▄██▄    ▄██▄",
        "                                                        ▄██▄▄██▄▄██▄▄██▄",
        "                                                      ▄██▄            ▄██▄",
        "                                                    ▄██▄▄██▄        ▄██▄▄██▄",
        "                                                  ▄██▄    ▄██▄    ▄██▄    ▄██▄",
        "                                                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄",
        "                                              ▄██▄                            ▄██▄",
        "                                            ▄██▄▄██▄                        ▄██▄▄██▄",
        "                                          ▄██▄    ▄██▄                    ▄██▄    ▄██▄",
        "                                        ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄",
        "                                      ▄██▄            ▄██▄            ▄██▄            ▄██▄",
        "                                    ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄",
        "                                  ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄",
        "                                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄",
        "                              ▄██▄                                                            ▄██▄",
        "                            ▄██▄▄██▄                                                        ▄██▄▄██▄",
        "                          ▄██▄    ▄██▄                                                    ▄██▄    ▄██▄",
        "                        ▄██▄▄██▄▄██▄▄██▄                                                ▄██▄▄██▄▄██▄▄██▄",
        "                      ▄██▄            ▄██▄                                            ▄██▄            ▄██▄",
        "                    ▄██▄▄██▄        ▄██▄▄██▄                                        ▄██▄▄██▄        ▄██▄▄██▄",
        "                  ▄██▄    ▄██▄    ▄██▄    ▄██▄                                    ▄██▄    ▄██▄    ▄██▄    ▄██▄",
        "                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄                                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄",
        "              ▄██▄                            ▄██▄                            ▄██▄                            ▄██▄",
        "            ▄██▄▄██▄                        ▄██▄▄██▄                        ▄██▄▄██▄                        ▄██▄▄██▄",
        "          ▄██▄    ▄██▄                    ▄██▄    ▄██▄                    ▄██▄    ▄██▄                    ▄██▄    ▄██▄",
        "        ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄",
        "      ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄",
        "    ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄",
        "  ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄",
        "▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄"
    };

    void run()
    {
        for( const string_view& sv: lines ) {
            print( "{}\n", sv );
        }
    }
}  // app

auto main() -> int { app::run(); }

Problem output (MSVC, standard output to Windows Terminal):

                                                              ▄██▄
                                                            ▄██▄▄██▄
                                                          ▄██▄    ▄██▄
                                                        ▄██▄▄██▄▄██▄▄██▄
                                                      ▄██▄            ▄██▄
                                                    ▄██▄▄██▄        ▄██▄▄██▄
                                                  ▄██▄    ▄██▄    ▄██▄    ▄██▄
                                                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄
                                              ▄██▄                            ▄██▄
                                            ▄██▄▄██▄                        ▄██▄▄██▄
                                          ▄██▄    ▄██▄                    ▄██▄    ▄██▄
                                        ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄
                                      ▄██▄            ▄██▄            ▄██▄            ▄██▄
                                    ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄
                                  ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄
                                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄
                              ▄██▄                                                            ▄██▄
                            ▄██▄▄██▄                                                        ▄██▄▄██▄
                          ▄██▄    ▄██▄                                                    ▄██▄    ▄██▄
                        ▄██▄▄██▄▄██▄▄██▄                                                ▄██▄▄██▄▄██▄▄██▄
                      ▄██▄            ▄██▄                                            ▄██▄            ▄██▄
                    ▄██▄▄██▄        ▄██▄▄██▄                                        ▄██▄▄██▄        ▄██▄▄██▄
                  ▄██▄    ▄██▄    ▄██▄    ▄██▄                                    ▄██▄    ▄██▄    ▄██▄    ▄██▄
                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄                                ▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄
              ▄██▄                            ▄██▄                            ▄██▄                            ▄██▄
            ▄██▄▄██▄                        ▄██▄▄██▄                        ▄██▄▄██▄                        ▄██▄▄██▄
          ▄██▄    ▄██▄                    ▄██▄    ▄██▄                    ▄██▄    ▄██▄                    ▄██▄    ▄██▄
        ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄                ▄██▄▄██▄▄██▄▄██▄
      ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄            ▄██▄
    ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄        ▄██▄▄██▄
  ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄    ▄██▄
▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄���█▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄▄██▄

The code here is simplified for the posting. With the original more elaborate coding there was more spurious output (Unicode error characters), which to me sort of indicates a timing problem?

Posted May 28, 2026, 10:52 AM UTC

326
Loading comments…