Ruby Output Unicode Character

前端 未结 5 1164
不思量自难忘°
不思量自难忘° 2020-12-24 05:18

I\'m not a Ruby dev by trade, but am using Capistrano for PHP deployments. I\'m trying to cleanup the output of my script and am trying to add a unicode check mark as discus

5条回答
  •  生来不讨喜
    2020-12-24 06:01

    In newer versions of Ruby, you don't need to enforce encoding. Here is an example with 2.1.2:

    2.1.2 :002 > "\u00BD"
     => "½"
    

    Just make sure you use double quotes!

提交回复
热议问题