JavaScript将字符串转换成字符编码列表,例如foo转换成 [112,111,111]
方法 1: JavaScript 1.6
Array.map('foo', function(x) { return String.charCodeAt(x) }) // is [112,111,111]
方法2: JavaScript 1.7
//http://www.75271.com [ String.charCodeAt(x) for each ( x in 'foo' ) ] // is [112,111,111]