As you may know, I’m currently building a man to html converter in ruby. I noticed that in many manpages, we have <
signs, that must, of course, be escaped in html. After a bit of looking around, I added a few lines of code to fix that issue. Quick fix, easy win :) Then things went weird!
Have a look at the screenshot below, especially the highlighted zones. See? Despite calling the exact same script with the exact same arguments, output is different from one shell to another: <
vs <
.
I quickly suspected the shell below to use an old version of the script, despite the fact that the which
points to the right file. So I modified something in the file, and saw the change happen in both shells. But the <
was still there…
After a while, I realized that rvm might be playing a trick on me. And indeed! The shell above uses ruby 1.8.7, where the shell below uses 1.9.3. And apparently, these two versions of ruby handle characters differently…
1 2 3 4 5 |
|
1 2 3 4 5 |
|
Good to know, let’s solve this bug now :)