From: 7stud -- Date: 2009-03-31T11:59:39+09:00 Subject: Re: Euro currency symbol 7stud -- wrote: > > $ri chr > ------------------------------------------------------------ Integer#chr > int.chr => string > ------------------------------------------------------------------------ > Returns a string containing the ASCII character represented by the > receiver's value. > > 65.chr #=> "A" > ?a.chr #=> "a" > 230.chr #=> "\346" > > > There is no ascii character with an ascii code equal to 8364. The pound > has been around a long time, and it made it into extended ascii (or > latin-1, which uses 8 bits). 8 bits can be used to store codes between 0-255. ascii characters are represented by numerical codes between 0-127, so the text describing the operation of chr in the docs is wrong. According to the description, you would expect codes above 127 to produce errors. But codes between 127-255 do not produce errors. The last example demonstrates that. The docs should read something like: Returns a string containing the latin-1 (or ISO-8859-1) character represented by the receiver's value. Valid character codes are 0-255. -- Posted via http://www.ruby-forum.com/.