0

I couldn't find any related answer to my question and I want to have a string like "╔══╗" but wrong characters are represented instead of them. I found the issue and that was because of signed characters and that values of each character is different with ascii table value of element. How can I do that with char in c++?

int main() {
    char a[] = "╔══╗";
    std::cout << a << std::endl;
}

1 Answers1

0

use std::wstring(included in <string>) and L"...":

#include <string>

int main(/**/)
{
    std::wstring wstr = L"╔══════════════╗";
}

NOTE: There is no good cross-platform way of printing such a string. See How to print a wstring?, How to print a wstring on MacOs or Unix?, C++ wide character locale doesn't work.

Nikita Demodov
  • 553
  • 5
  • 17