From: David Wright Date: 2009-03-31T09:10:08+09:00 Subject: Euro currency symbol Hmm, I seem to be having a bit of a time representing the Euro sign in Ruby. ruby -v ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0] (same results on a linux box, 1.8.5 with Ruby) symbol: ��� Decimal: 8364 hex: 20Ac html number: € html name: € description: euro sign dwright@[1061]:dwright% perl -C2 -le 'print chr(oct("20254"))' ��� dwright@[1062]:dwright%ruby -le 'puts "20254".oct.chr' -e:1:in `chr': 8364 out of char range (RangeError) from -e:1 dwright@[1063]:dwright%irb >> puts "20254".oct 8364 >> puts "20254".oct.chr RangeError: 8364 out of char range from (irb):5:in `chr' from (irb):5 ruby -e 'puts "20Ac".hex.chr' -e:1:in `chr': 8364 out of char range (RangeError) from -e:1 ruby -KU -e 'puts "20Ac".hex.chr' -e:1:in `chr': 8364 out of char range (RangeError) from -e:1 ruby -KU -e '$KCODE="u";puts "20Ac".hex.chr' -e:1:in `chr': 8364 out of char range (RangeError) from -e:1 ruby -e "puts '20Ac'.hex.chr" -e:1:in `chr': 8364 out of char range (RangeError) from -e:1 Here's the pound: ruby -e 'puts "The pound:\243"' The pound:�� ruby -e 'puts "243".oct.chr' �� -- Posted via http://www.ruby-forum.com/.