Wednesday, April 28, 2010

CakePHP and Umlauts (utf-8)

I spent the last couple of weeks writing PHP. Not my favorite language, but it does get the job done. I won't bitch about PHP here, since that would be snobbery.

What eases the pain a lot is the CakePHP framework. Except, I couldn't get Umlauts to work. Umlauts are special characters, like a, o and u, but with two dots on them: ä, ö, ü.

I found the solution on this page: http://www.missingfeatures.com/2008/10/23/using-utf8-in-your-cakephp-app/

Not only must you tell your browser that you are using UTF-8, but you must also tell the database connection to use utf-8. Check the database.php file in your app/config directory and add 'encoding' => 'utf8' to the end of the database configuration.

Wednesday, April 14, 2010

Wiki syntax for UML diagrams

Yay! I have just implemented my very first Trac Hack: YumlPreprocessorMacro for integrating yuml.me diagrams into the trac wiki.

I have come to depend on using Trac as a bug tracking and documentation tool. I really like using wikis for documentation. I like being able to create links quickly. I like being able to search the documentation in a webby way. I absolutely hate using MS Word for technical documentation.

Often, you want to add little UML sketches to your docs. The workflow normally goes like this:

  1. Open your UML editor of choice
  2. Create UML diagram
  3. Export as image
  4. Include in documentation
Notice how that can be a little disruptive for just a sketch? Most UML tools want you to go BDUF. They want you to create a whole model of everything, when all you really want to do is a little use case. I like the Violet UML Editor precisely because it lets me sketch. But yuml.me really changes the whole game!