Subject: Re: what is this syntax: \001\002 ?
From: "Gaspard Bucher" <gaspard teti.ch>
Date: Wed, 12 Sep 2007 21:26:24 +0900
References: 268761268764268772
In-reply-to: 268772
A byte is coded on 8 bits, so the maximum is 255 hence the strange
results below :
irb> 8 * 8 * 7 + 8 * 7 + 7
=> 511
irb> "\777".inspect
=> "\377"
irb> "\777"[0]
=> 255
irb> "\377"[0]
=> 255
\777 is invalid and is truncated to \377.