Take this text for example:
the three umlauts are ä, ö, and ü..
Let’s assume they are in a text file, which I’m reading like this:
data = File.read("umlauts.txt")
Now, if I try to output them, I get this:
the three umlauts are Σ, ÷, and ⁿ.
If I write it to a file, they get outputted correctly. How can I make them show up properly on a windows command prompt? I’m using Ruby 1.8.6. I want to be able to perform quick debug from the command prompt.
What encoding is the file? I’m guessing probably utf-8. Windows cmd prompt does not use utf-8.
Here’s a good article that covers this: http://illegalargumentexception.blogspot.com/2009/04/i18n-unicode-at-windows-command-prompt.html