“Truth lies within a little and certain compass, but error is immense.”

I’ve been working on PledgeBank quite a bit recently. As well as adding survey emails asking whether signers have done their pledge, and a feature for people to contact a pledge’s creator, I’ve been fixing numerous bugs that have sprung up along the way. For starters, people on the Isle of Man and the Channel Islands now get a much more helpful error if they try and enter their postcode anywhere on the site, rather than the confusing postcode not recognised they were getting previously.

Other errors I found turned out not to be with our code. The PledgeBank test suite (that we run before deploying the site to check it all still works) was throwing lots of warnings about “Parsing of undecoded UTF-8 will give garbage” when it got to the testing of our other language pages. Our code wasn’t doing anything special, and there were multiple places the warning came from – upgrading our libwww-perl removed one, and I’ve submitted bug reports to CPAN for the rest (having patched our copies locally – hooray for open source).

The Perl warnings were at least understandable, though. While tracking down why the site was having trouble sending a couple of emails, I discovered that we had a helper function splitting very long words up to help with word-wrapping – which when applied to some Chinese text was cutting a UTF-8 multibyte character in two and invalidating the text. No problem, I think, I simply have to add the “/u” modifier to PHP’s regular expression so that it matches characters and not bytes. This didn’t work, and after much playing had to submit a bug report to PHP – apparently in PHP “non-space character followed by non-space character” isn’t the same as “two non-space characters in a row”…

2 Comments

  1. ?????? ????? ????????? ????? ??????? ? ??????????? ????????? ?????? ?? ?? ??????. ????? ?? ??? ???? ????? ?????????? ??, ??? ?????? ??????? ????????????? ??????????? ????????? ? ????? ???????? ??????????? ???????? ? ????????????? ? ???, ????? ?????? ???? ?????????? ???. ????? ? ??? ????? ?????, ??????? ????? ??????, ?????? ??????? ? ????? ????? ????. ?????? ????? ?????? ?????????? ? ????????????? ?????????, ?????????????? ???????????, ????????? ??????? ?? ?????????????? ???????? ?? ????????-????? cottageks.ru
    ?????????????? ?????????