Qt: Fixing bug while saving non-ASCII characters