There's a few special characters from code page 437 that i want to use within a function that prints n-ary trees so i can do something like this:
http://www.randygaul.net/wp-content/uploads/2015/06/Capture1.png
(Basically something similar to the tree command in linux)
The problem is, my algorithm is using setlocale(LC_ALL, "Portuguese") which messes up with those special characters. I wanted to know if i can somehow apply C default locale to that function alone.
Just save the current locale, and then restore:
Notice, locale is shared between all threads in a process, so you need to pause all other threads (or make sure they don't call any locale dependent functions) while calling such function.
From posix setlocale: