LoginSignup
2
2

More than 5 years have passed since last update.

各文字のUnicode Code Pointを表示する

Last updated at Posted at 2012-12-05
disp_ucp.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

ARGV[0].split(//).each do |ch|
  puts "#{ch} [U+#{ch.unpack('U').first.to_s(16)}]"
end
$ ruby disp_ucp.rb プログラミング知識を共有しよう。
プ [U+30d7]
ロ [U+30ed]
グ [U+30b0]
ラ [U+30e9]
ミ [U+30df]
ン [U+30f3]
グ [U+30b0]
知 [U+77e5]
識 [U+8b58]
を [U+3092]
共 [U+5171]
有 [U+6709]
し [U+3057]
よ [U+3088]
う [U+3046]
。 [U+3002]
2
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2