Ensure python text domain gets the right encoding. (cherry picked from commit 65dbb1bd46f6bb632e31a262c1486c49fc024157)