From: James Gray Date: 2009-04-17T05:07:15+09:00 Subject: Re: querying using HTTP On Apr 16, 2009, at 2:44 PM, Brian Candler wrote: > James Gray wrote: >> > > Consider an app which is bundled with HTML templates, which the app > reads using File.read(). The templates happen to be written using, > say, > UTF-8. It all works fine on my machine, and passes all tests. > However it > barfs when run on someone else's machine, because their environment > variables are different. But you bundled those files. You know the encoding much better than Ruby. Is it really too much to ask for? html = File.read("my_template.html", external_encoding: "UTF-8") That's more correct than any magic behavior would be and self- documenting to boot. > - File#read returns a string with encoding='BINARY' File.binread() was added for exactly this purpose. >> Can you list what's not yet covered in my blog series? > > I've posted a bunch of lists before. Yeah, I've read those. I responded to your last one yesterday telling you that I had no addressed all the concerns I saw in that one, plus some more. I'm sure trying to help you. I guess it's time for a new list of what you're still missing… > Trying out in irb used to be a good way to test ruby, but that's no > good > in ruby 1.9 because it's not consistent with script behaviour. While I agree that IRb may need some more integration, there has always been some minor differences between how code runs in it and how it runs in a real Ruby script. I don't think this means 1.9 isn't read for the masses. James Edward Gray II