Wednesday, August 19, 2009

Success with characters

I've solved the "question mark" problem with my web site! After careful testing and experiments (with some help from web pages), I found the problem was in my implementation of Gettext(). I needed one additional call to bind_textdomain_codeset () and now the web site displays the expected characters. Yay!

This was an interesting problem. My early analysis of the problem led me down the wrong path. I had used PHP in command-line mode, and those tests produced the proper characters on the console. (I'm still not sure how that happened.) Since PHP and Gettext() were giving me the correct results, I thought the problem was in Apache.

Later tests with other text in the web page showed me that I was wrong -- Apache was providing characters just fine. I narrowed the problem to Gettext(), and then it was an easy fix.

During these tests, I put the project under version control. It's now important enough to keep older versions. And I can use the experience with Subversion -- I still have problems  getting the right directory names when importing projects. (I had difficulties in this area with PVCS and SourceSafe too. Since it affects every version control system that I have used, maybe it is in how I think about version control systems.)

No comments:

Post a Comment