This post is actually related to programming, but I think it's neither C nor C++ specific or similar. I read a lot about Unicode and the UTF-8 character coding system today but there are still some things I don't really understand when programming.
Assuming my operating system is configured only to use UTF-8 encoding, also for filesystem and everything. Now I got a text-file (UTF-8 encoded) and read it into a char-array using 'fgets' (or a C++ specific way to read the file, doesn't matter).
When I print the read char-array (or string) using 'printf' (or 'cout'), will it be printed correctly (assuming the text-file contains some 2-byte UTF-8 encoded characters and not only ASCII compatible ones)?
Is there some kind of transformation done between the file and whatever is read into the char-array from my program? Or would I have to write the program in such a way it can handle UTF-8 encoded text?