Comment 27 for bug 989496

Revision history for this message
Michael Terry (mterry) wrote : Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 117

I think there are at least two things going on here.

1) The way duplicity is currently using it, gettext will return strings in whatever codeset the translation file happens to define. Which is hard to predict. If it is returned as unicode (not utf8, but actual wide byte unicode), then we get the "'ascii' codec can't decode" message. This can be forced by using the unicode=True flag for gettext.install. And it can be fixed by using the codeset='utf8' flag instead.

2) Filenames may not be in utf8. I think this is actually a pretty rare thing, but I'm betting we don't handle it well and it leads to "'utf8' codec can't decode" messages.

Looking further. I seem to be getting situation #1 in more cases than I would naively expect (like, no translation file at all).