From: Joe Van Dyk Date: 2005-09-19T08:30:44+09:00 Subject: Re: StringScanner question On 9/18/05, Gavin Kistner wrote: > On Sep 18, 2005, at 5:05 PM, Joe Van Dyk wrote: > > On 9/17/05, Jon A. Lambert wrote: > >> Jon A. Lambert wrote: > >> Dear Jon, > >> > >> If you had bothered to read the source code you would have found a > >> bunch of slick character encoding tables in regex.c and know that > >> the lengths of characters in strings are dependent on the encoding > >> options you be running on. As long as you be using usacii then > >> you'll be alright, but if you start messing with kanji you'll be > >> bitten on > >> the ass as StringScanner will suddenly be popping and hopping > >> through 1,2, or n bytes at a time with getch. So I'd recommend > >> using getbyte. > >> > >> There are enough hints about such things dropped in the very first > >> chapters of the "Coding Ruby: The Canonical Coder's Guide". > >> Pay attention and do some research before wasting our time. > >> > > > > It's necessary now to read C source code to figure out the API for > > StringScanner? > > To be clear, I believe Jon's harsh response was written in response > to himself. He was saying "Oops, I figured it out myself." Yeah, I noticed that. But still, it shouldn't be necessary to read source code to figure out API documentation.