The problem with changing the quotes is that my program will be reading a long list of quotes from a .txt file not made by me but sent to me.
My professor wants us to use the .txt that he has provided. It is a long list of quotes, each on a separate line, and my program is reading from that file a displaying it in the console.
I was wondering if there was any way for my console to display the characters in the .txt file exactly as they are without having to edit the .txt file myself.
I was wondering if there was any way for my console to display the characters in the .txt file exactly as they are
Linux console displays them exactly as they are, since it supports Unicode everywhere. I bet you're on Windows, which makes these things complicated and there isn't enough information to say how to fix it. What exactly were the "strange characters"? What encoding does the file use? what version of visual studio do you compile that with? etc.
Yes, I am on windows 10. I'm using CodeBlocks for my IDE and the GNU GCC Compiler.
The console is displaying ΓÇ¥ instead of quotation marks, and ΓÇÖ for apostrophes. I'm pretty sure the .txt file was written in notepad but I am not sure because everyone is linking the same file our professor provided.
Thanks for the help, not sure it's absolutely necessary to fix this but curious as to what the problem is.
The character ” is RIGHT DOUBLE QUOTATION MARK (U+201D)
Its UTF-8 encoding is 0xE2 0x80 0x9D - that's the correct way to store it in a text file.
"ΓÇ¥" is how those three bytes appear when displayed as MS-DOS code page 437, the original IBM PC single-byte encoding from 1981. This leads me to believe that your Windows console is configured for that code page (or one of its variants)
I've only ever used Visual Studio on Windows, which has a couple different ways to fix this, but I am sure a search for "How to print UTF-8 file in Code Blocks" will turn something up.