Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我尝试255.chr,Ruby 会返回"\xFF"。为什么"\xff".ord返回160(0xA0)?我在 Windows 7(64 位)上使用 IronRuby 2.0.0p451
255.chr
"\xFF"
"\xff".ord
160
不适合我:
root@xxxxxxx:~# irb 2.1.0 :001 > "\xff".ord => 255 2.1.0 :002 > 255.chr => "\xFF" 2.1.0 :003 > "\xFF".ord => 255 2.1.0 :004 >