本帖最后由 taroxd 于 2015-2-10 19:09 编辑
三锅炉 发表于 2015-2-10 18:59
我就是在看RUBY帮助文档的时候看不懂。。
puts (0..127).map(&:chr).join # ↓ the exclamation mark is returned by 33.chr # [omit some mysterious characters] !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ # ↑ the quote mark is returned by 34.chr # and so on...
puts (0..127).map(&:chr).join
# ↓ the exclamation mark is returned by 33.chr
# [omit some mysterious characters] !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
# ↑ the quote mark is returned by 34.chr
# and so on...
原因啥的就是3L的那个编码表。人家就是这么编码的。
数到A就是65 |