Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Character encoding problem

Greetings,

I'm developing a project in C++ where I want to use characters like á é õ and ┌ ─ ┐ │ to draw a couple of nice frames. My doubt resides in what I should change in my code/project settings since, without any kind of modifications, the console just prints pseudo-random characters.

I know that the above characters are defined in the character set Code page 437 aka Extended ASCII, but what I should do know?

After some research, I included the instruction setlocale(LC_CTYPE, ""); and now I can print accented characters (à é õ) but can't print the borders.

Also, should I use char and string or wchar and wstring to use these characters?

Thanks

Answer*

Draft saved
Draft discarded
Cancel

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /