# Mechanize 0.7.3 Released

**URL:** <https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737>\
**Category:** Ruby\
**Created:** [March 12, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737 "2008-03-12T21:17:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 12, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/1 "2008-03-12T21:17:31Z")

</div>

mechanize version 0.7.3 has been released!

- [http://mechanize.rubyforge.org/](http://mechanize.rubyforge.org/)

The Mechanize library is used for automating interaction with websites.  
Mechanize automatically stores and sends cookies, follows redirects,  
can follow links, and submit forms. Form fields can be populated and  
submitted. Mechanize also keeps track of the sites that you have  
visited as  
a history.

Changes:

# Mechanize CHANGELOG

## 0.7.3

- Pages are now yielded to a blocks given to WWW::Mechanize#get

- WWW::Mechanize#get now takes hash arguments for uri parameters.

- WWW::Mechanize#post takes an IO object as a parameter and posts  
correctly.

- Fixing a strange zlib inflate problem on windows

- [http://mechanize.rubyforge.org/](http://mechanize.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 12, 2008, 11:58pm UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/2 "2008-03-12T23:58:52Z")

</div>

Aaron P. wrote:

> mechanize version 0.7.3 has been released!

Thanks for mechanize–we use mechanize at work and it works well.

Question on strings:  
I seem incapable of figuring out how to ‘recreate’ this string in  
“string” format:

Here it is byte by byte

bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115,  
32, 112, 114, 101, 118, 105, 111, 117]  
for b in bytes do all \<\< b; end # create the string  
all == “dent?\<80\>\<99\>s previou” # it compared with itself in string form

?  
Thanks!

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 12:54am UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/3 "2008-03-13T00:54:06Z")

</div>

On Thu, Mar 13, 2008 at 07:58:44AM +0900, Roger P. wrote:

> Aaron P. wrote:
> 
> > mechanize version 0.7.3 has been released!
> 
> Thanks for mechanize–we use mechanize at work and it works well.

Thank you!

> all == “dent?\<80\>\<99\>s previou” # it compared with itself in string form  
> Try using pack:

bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115,  
32, 112, 114, 101, 118, 105, 111, 117]  
bytes.pack(‘C\*’) == “dent?\<80\>\<99\>s previou”

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 1:13am UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/4 "2008-03-13T01:13:35Z")

</div>

Roger P. wrote:

> Aaron P. wrote:
> 
> > mechanize version 0.7.3 has been released!
> 
> Thanks for mechanize–we use mechanize at work and it works well.
> 
> Question on strings:  
> I seem incapable of figuring out how to ‘recreate’ this string in  
> “string” format:
> 
> Here it is byte by byte
> 
> bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115,  
> 32, 112, 114, 101, 118, 105, 111, 117]  
> for b in bytes do all \<\< b; end # create the string  
> all == “dent?\<80\>\<99\>s previou” # it compared with itself in string form
> 
> ?  
> Thanks!

ascii\_codes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62,  
115,  
32, 112, 114, 101, 118, 105, 111, 117]  
str = “”

for code in ascii\_codes  
str \<\< code.chr  
end

puts str

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 3:57am UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/5 "2008-03-13T03:57:12Z")

</div>

Hi –

On Thu, 13 Mar 2008, Aaron P. wrote:

> > I seem incapable of figuring out how to ‘recreate’ this string in  
> > “string” format:
> > 
> > Here it is byte by byte
> > 
> > bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115,  
> > 32, 112, 114, 101, 118, 105, 111, 117]  
> > for b in bytes do all \<\< b; end # create the string  
> > all == “dent?\<80\>\<99\>s previou” # it compared with itself in string form
> 
> Try using pack:

In other words:

pack, Pack!

The roster of community members whose last names are core methods  
(give or take a capital letter) is growing. There are at least three  
at this point (Freeze, Keys, and Pack).

David

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 4:10am UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/6 "2008-03-13T04:10:40Z")

</div>

Questions:

The following ways all recreate my original string, however I am having  
trouble getting the comparison work to itself expressed in string  
form–it’s like the string form doesn’t express all the inside chars or  
something–am I missing something? Is there a way to recreate the  
string along the lines of “dent?\226” and, as a follow up, is  
complicated\_string.inspect just not displaying the interior characters  
right?

> > bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115,  
> > ?\> 32, 112, 114, 101, 118, 105, 111, 117]
> 
> > bytes.pack(‘C\*’) == “dent?\<80\>\<99\>s previou”  
> > =\> false
> 
> > str = “”  
> > =\> “”
> 
> >

?\> for code in bytes

> > str \<\< code.chr  
> > end  
> > =\> [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115, 32,  
> > 112, 114, 101, 118, 105, 111, 117]
> 
> > str == “dent?\<80\>\<99\>s previou”  
> > =\> false
> 
> > str = bytes.map{|n| n.chr}.join  
> > =\> “dent?\<80\>\<99\>s previou”
> 
> > str == “dent?\<80\>\<99\>s previou”  
> > =\> false

Just wondering if anybody can enlighten me.  
Guess we just need more people named by Ruby names, huh?  
Take care.  
-R

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 3:36am UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/7 "2008-03-13T03:36:01Z")

</div>

On Mar 12, 4:58 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115,  
> 32, 112, 114, 101, 118, 105, 111, 117]  
> for b in bytes do all \<\< b; end # create the string

bytes = [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57,  
62, 115, 32, 112, 114, 101, 118, 105, 111, 117]

puts bytes.map{|n| n.chr}.join

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 7:25am UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/8 "2008-03-13T07:25:53Z")

</div>

Roger P. wrote:

> =\> [100, 101, 110, 116, 226, 60, 56, 48, 62, 60, 57, 57, 62, 115, 32,  
> 112, 114, 101, 118, 105, 111, 117]
> 
> > > str == “dent?\<80\>\<99\>s previou”  
> > > =\> false
> > 
> > > str = bytes.map{|n| n.chr}.join  
> > > =\> “dent?\<80\>\<99\>s previou”
> > 
> > > str == “dent?\<80\>\<99\>s previou”  
> > > =\> false

irb(main):002:0\> ?A  
=\> 65  
irb(main):003:0\> ??  
=\> 63  
irb(main):004:0\> 226.chr  
=\> “\342”  
irb(main):005:0\> puts 226.chr  
Ã

The character whose ASCII code is 226 is not a question mark.  
The ASCII code of a question mark is 63.

irb(main):008:0\> puts [100, 101, 110, 116, 226].map{|n| n.chr}.join  
dentÃ  
irb(main):009:0\> “342”.to\_i(8)  
=\> 226

Octal for 226 is 342.

---

<div class="post-metadata">

**Author:** ![aaronpowell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Post date:** [March 13, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737/9 "2008-03-13T18:23:56Z")

</div>

On Thu, Mar 13, 2008 at 11:56:28AM +0900, David A. Black wrote:

> > Thank you!
> > 
> > > for b in bytes do all \<\< b; end # create the string  
> > > at this point (Freeze, Keys, and Pack).  
> > > I’ve submitted my patch to add the “patterson” method to Array, but I  
> > > haven’t heard anything back…
