Describe the bug
When the full-width character is output in cout, blank is output without permission
Command-line test case
C:\Temp>type main.cpp
// file encoding: utf-8 or Shift JIS
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
system("chcp 932 > NUL"); // system("chcp 65001 > NUL");
cout << "あいうえお" << endl;
}
C:\Temp>cl /EHsc /W4 /WX /utf-8 main.cpp
or
C:\Temp>cl /EHsc /W4 /WX main.cpp
Оптимизирующий компилятор Microsoft (R) C/C++ версии 19.27.29109 для x64
(C) Корпорация Майкрософт (Microsoft Corporation). Все права защищены.
main.cpp
Microsoft (R) Incremental Linker Version 14.27.29109.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
C:\Temp>main.exe
あいうえお
Expected behavior
Should print without additional spaces.
Actually it works. I can't reproduce the bug.
Works for both utf-8 and Shift JIS.

STL version
Microsoft Visual Studio Community 2019 Preview
Version 16.7.0 Preview 6.0
Additional context
VSO-441122 / AB#441122 | DevCom-59694
wcout and L"str" also works fine:
#include <iostream>
#include <cstdlib>
#include <cassert>
#include <windows.h>
#include <io.h>
#include <fcntl.h>
using namespace std;
int main()
{
int result = _setmode(_fileno(stdout), _O_U16TEXT);
assert(result != -1);
wcout << L"あいうえお\n";
}

If you will test too, check that your cmd font is NSimSun or MSGothic.
The examples don't work with Lucida Console or Consolas fonts.

The console adds spacing between hiraganas, to keep hiraganas aligned with letters. I guess that's why the reporter thought that whitespace characters are outputted.


I see. Every Unicode symbol fits '2 spaces' in console. and Ansi symbol fits '1 space'.
The issue is better shown even for Cyrylic symbols :)
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
system("chcp 65001 > NUL");
cout << "ABABABABAB\n"; // English
cout << "あいうえお\n";
cout << "АВАВАВАВАВ\n"; // Russian
}

I think this is by design :)
Thanks @cpplearner and @fsb4000! I've resolved the DevCom bug with links to your analysis and screenshots.
Most helpful comment
The console adds spacing between hiraganas, to keep hiraganas aligned with letters. I guess that's why the reporter thought that whitespace characters are outputted.

