开发者

How do I create a checkmark in unicode?

I would think it would be:

"✓".encode(:unicode)

But I think this is not the correct usage of .encode. And when I say:

"✓".encode('Unicode')

it cannot do the conversion开发者_开发百科.


If you're using Ruby 1.9 (which has much better built-in encoding support), you can do this:

> checkmark = "\u2713"
# => "✓" 
> checkmark.encoding
# => #<Encoding:UTF-8> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜