Reputation: 20675
I'm trying to print out some Unicode characters:
# encoding: utf-8
puts "ử ậ ắ ặ ố ồ"
If I run it through Powershell, this is what I get:
If I run it through cmd, this is what I get:
If I run it in Eclipse (with Aptana Studio 3 plugin), this is what I get:
Is it a problem with my system/software or is it Ruby's problem? How can I get it to work?
It works on Ideone though: http://ideone.com/PdycKH
Upvotes: 2
Views: 478
Reputation: 20675
I figured it out:
cmd
and Powershell
, I have to change the font (I changed to Consolas)Encoding
to Other: UTF-8
Upvotes: 1
Reputation: 33954
Ruby supports it no problem, and setting the formatting at the top of the file is the way to go.
The issue is the display via the command line window. You need to use both a font and character page that supports Unicode display.
See this question regarding doing this in the Windows command line.
Upvotes: 4