Posts /

SproutCore encoding gotchas

Twitter Facebook Google+
30 Sep 2010

These days I’m trying out SproutCore, an MVC framework written in Javascript that aims to help developing rich client web applications. I’m not going to entertain you with any juicy technical spotlight, as they’ll hopefully find their way in these pages later on with plenty of details. At the moment I’d like to share a little problem I got stuck with that had a non trivial solution, at least for the noob I am.

First thing you have to know is that SproutCore ships with both a rich Javascript library and a set of building tools written in ruby, which go under the code name of abbot. New projects kickstart, scaffolding, automatic documentation are among the features that abbot provides you with, along with the ability to run you application on a local web server during development. Sounds cool, isn’t it? And I didn’t even mention it’s integrated unit testing facility!

I immediately tried to give it a shot, and ran through one of the tutorials to write down my first HelloWorld. The first pieces got into place, and after the first quick round I left my hello world project in such a state that I already decided to build a simple but complete application right away. How arrogant.

The second day something Bad™ happened, I cannot really tell what, but everything started to fall apart: no one tool in the abbot suite worked properly, I was no more able to get any further and I started a painful journey of which I only remember installing and changing between zillions of ruby versions, crying and considering to give up with IT and to start my own religion to make a living.

But then I simply resorted to the #sproutcore IRC channel and I got the tip that saved the day (thanks pjmorse!):

export LC_CTYPE=UTF-8

“Boom baby!” I said, everything got back to normality. I can save my holy plans for a rainy day. It seems that encoding is an endless source of issues in the ruby world, so that probably if you have any ruby knowledge whatsoever this all rant might just seem pointless and the solution trivial.

Next episode on SproutCore (if everything goes well): a sample SproutCore + Clojure application. See you there!


Twitter Facebook Google+