More work on the database migration script: the UTF-8 conversion stuff appears to be working correctly now.