May, 2014 browsing by month


Updating a PHP, MySQL, and Javascript Site to Support Foreign Languages with UTF-8

Saturday, May 17th, 2014

Recently on SourceAudio we decided to make supporting foreign languages a priority. We’d always supported html encoded foreign language characters but clients found that extremely clumsy and had no desire to learn that arcane syntax, for which I couldn’t blame them. The solution was to start supporting them properly, which meant switching out character encoding across all layers of the site. After some deliberation, we decided to go with UTF-8, since that would get us all the characters we needed and seemed to have the widest support.

If you’re not familiar with character encoding, Joel Spolsky gives a good overview here. Basically, we needed to support characters like õôóõêç and 测试 in addition to the traditional English characters.

With that decided, it was time to start working on the layers. First up, we needed our backend data to be stored in UTF-8 and that meant updating MySQL.

Click to continue »


Sunday, May 11th, 2014

I’ve had several topics come up while working at SourceAudio that would be perfect for posting according to my goal of writing about topics that are tricky to Google. However, it’s hard to decide sometimes whether it’s better to share or if there’s a competitive advantage to keeping certain things hard to discover.

Simple topics, like running benchmarks of different ways to instantiate classes in Javascript, I don’t really worry about. Sure, I guess there’s an advantage to the company for that to be hard to find out but it’s not a big one and it’s not hard to come up with on your own.

But what about a more complex topics, like how to generate iTunes compatible metadata in AIFF files or how to properly estimate the size of zip files when creating them on the fly? I loved figuring that stuff out and it’d be fun to write about but those topics could be of interest to SourceAudio competitors so do I have a responsibility to keep it a secret? Not that those things are impossible to discover if someone was interested but the time involved in doing the research, in poking around at files, in poring over documentation, in running test after test until I got it just right – all that really adds up. There’s value in that knowledge.

As someone who’s benefited heavily from others being willing to share their valuable knowledge, do I have an obligation to share when I figure something out? Or is the greater obligation to the company?

It’s the classic “Information wants to be free” problem and I don’t have the answer. My heart wants to set it loose but my head is a bit more cautious. I’m usually a head guy, which I guess explains why I haven’t posted in a couple years, but I don’t want be Smaug, sleeping forever on my piles of information and contributing nothing. How do you know when it’s time to open up the Lonely Mountain?