How can I make platinum characters without spaces Ruby 1.8?

I am using Ruby 1.8. It seems that downcase does not change non- downcase characters. For instance:

 "Δ".downcase 

returns "Δ"

I know that in Ruby 1.9.1 and later, I can use Unicode Utils ( from here ). I tried this and it works well. Returns "δ" for the previous example.

Is there an equivalent (or any) solution for 1.8 Ruby?

+6
source share
1 answer
 nash@nash :~$ ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux] 

gem install unicode ( https://rubygems.org/gems/unicode )

 require 'unicode' $KCODE = 'u' p Unicode::downcase "Δ" #=> "δ" 
+3
source

Source: https://habr.com/ru/post/892502/


All Articles