0

So I want to print a hebrew character, unicode value of \u{fb20} into the Rubymine console, the common output where hello world would typically go if you were to just run puts 'hello world'.

The code I am trying to run is just puts "\u{fb20}", nothing crazy.

Rubymine is set to default system encoding for both projectg and IDE levels, and I have tried setting the encoding to UTF-8 and UTF-16, but neither of these three setting will simply print this character correctly to the console.

I get ﬠ printed to the console at the moment, which is not the right character. The right character is .

Musannif Zahir
  • 3,001
  • 1
  • 21
  • 31
  • 1
    The UTF-8 representation of `ﬠ` is the three bytes `xEF`, `xAC`, `xA0`. Those three bytes interpreted as ISO-8859-1 are `ï¬ ` (where the last character is non-breaking space). So it looks like your IDE is using ISO-8859-1 (or Window-1252) when displaying the bytes from Ruby. – matt Jul 22 '15 at 17:46

1 Answers1

0

Try encoding the character in ruby, and then printing it.

symbol = "\ufb20"
puts symbol.encode('utf-16')

And change Rubymine to be encoded in UTF-16

jkeuhlen
  • 4,401
  • 23
  • 36