An interesting thing happened when I “pulled the trigger” and went live with the new version of the Niche Software web site - a good friend of mine noted that the navigation menu wasn’t working when he browsed the site using his Lumia 520 - when the responsive design collapsed into a “hamburger menu”, it was unresponsive.
A quick round of testing later and I’d verified the problem across a number of browsers on different platforms - using Internet Explorer 10 from my Windows 7 desktop at work, using IE 11 on my Surface RT, using whatever the browser is on my Samsung ATIV S, and using Firefox, IE 11 and Chrome on my laptop. All the browsers agreed: the hamburger menu wasn’t working.
It was when I discovered that everything worked fine when hosted by my laptop that things started taking a peculiar turn - no longer was it a bug in my code, but a defect caused during deployment.
Figuring that the problem had to be related to a missing or corrupted file - one that had not been uploaded to my host, or that had been corrupted enroute - I started a file comparison between my host and my working folder on my laptop.
All the files seemed to be present and correct. Except that a few were a different size than expected.
Turns out that I’d been the victim of an over zealous end-of-line conversion routine.
You see, buried in the depths of the FTP protocol is an option to transfer files as either binary or text. Binary files are transferred as is, but text files get converted on the way through to suit the text standards of the target platform. Uploading from a Windows laptop to a Linux based web server, all my “text” files had been converted from their standard CR-LF end of line marking to Linux style LF marking.
Such conversion works just fine for any ASCII based text file … but the Bootstrap JavaScript files aren’t ASCII - they’re unicode files.
For the purposes of FTP, a unicode text file is really just another kind of binary file. Switching the configuration of my FTP client so that all files are handled as binary files fixed everything up and now the collapsed menu works just fine.
Sort of proves that the more things change, the more they stay the same - I could solve the problem I had with my brand new website because I was familiar with the operation of the FTP protocol. This protocol was defined 1971, long before the invention of Jekyll, Liquid, Unicode, PowerShell, Python or Ruby.
Seems as though you can never tell when yesterday’s knowledge will help solve today’s problems. Posted under the Good Samaritan Principle in the hope that it will help someone else.
Comments
blog comments powered by Disqus