Character varieties and differential operators on surfaces